0

I'm trying to redirect all visits to a site's splash page (/index.html) to a page deep in the hierarchy (/a/b/c/d.html). My redirect rule manages an empty path, but does an infinite loop if I go directly to the index page. What am I doing wrong?

It's a shared, legacy server, with static content only (no PHP). There's an error log, but it's only showing 404 errors for the mis-named pages.

I've tried redirecting to a path relative to root, and it goes to a different URL; I'm guessing the host's doing some weird URL-masking thing...

.htaccess

DirectoryIndex index.shtml index.html
Redirect permanent /index.html http://example.com/a/b/c/d.html

results:

  • example.com -> /a/b/c/d.html
  • example.com/ -> /a/b/c/d.html
  • example.com/index.html -> /a/b/c/d.html/a/b/c/d.html/[..]/a/b/c/d.htmlindex.html

Note that index.html is appended in the last example. I guess it's something to do with replacing the slash - but how do I fix it!?

0

The problem was Firefox -- or, rather, that my browser had cached an older, broken redirect. The following steps cleared it:

  • ctrl-H
  • search for example.com
  • right-click
  • forget about this site

The redirect works as written.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.