So here is one that has me stumped. I’m trying to redirect posts from an old forum that I’ve converted from phpbb to vbulletin. In the .htaccess file, I’ve put in the following:
That will redirect the root directory to the forum directory on the new site properly. What I can’t get are the individual pages to work. If I enter the following:
Before you test it, please make sure to empty the cache of your browser and restart it. Browsers cache 301 redirects, so if they have an old redirect stored somewhere they will use that instead of the new one.
While testing it’s better to use 302 redirected (which should not be cached browsers) and then switch to 301 once you’ve established it works.
I’ve just tested the code I showed you, and it works fine here. Could you please post your complete .htaccess?
Also, which version of Apache are you on, 1.x or 2.x ?
For reasons I cannot explain, after about 2 minutes, whatever it was that was causing the problem just stopped and using your suggestion works although the standard does not.
Perhaps it was the browser cache? Hard to say because I thought I had IE as autoemptying. Another good one to know after much frustration. Again, many thanks!!
One last question if I may - the only thing not redirecting now is the root - I tried doing just a rewrite rule with either /index.php or just a / and neither worked. Is there anything you can suggest that would complement the above for this? (I’ve actually just purchased the hardcover mod rewrite book just now )
Note: The Redirect statements did not work because (I believe) mod_alias can’t look at the query string. That’s why Rémon recommended mod_rewrite, the Swiss Army Knife for webmasters.