Forum Moderators: phranque
- Redirecting directories of content from old server to a specific landing page on new server. (No filenames or directories are the same.)
- Force case insensitivity
The redirects work for almost all rules except for one (I haven't figured this out yet.)
But the odd thing is that I can't get the browser to show the new URL. It's got to be an Apache config that I'm missing, because it works great in another server environment.
Here's an example:
RewriteRule ^[Dd]irectory/[Ss]ub_[Dd]irectory(.*)$ http://example.com/dir/sub-dir [L]
When the incoming URL is:
http://example.com/Directory/Sub_Directory/main.asp
The page redirects to the correct location, but the browser URL is still shown as:
http://example.com/Directory/Sub_Directory/main.asp
Your code should produce a 302 redirect, unless something else interferes with it.
The 302 redirect would be bad in and of itself; you should have a 301 redirect here.
If you are not re-using the $1 back-reference, there is no need for '(' and ')' round the '.*' part. In fact the '.*' and the closing '$' are both completely redundant.