I have inherited a site (a vbulletin forum) and migrated it from another hosting to mine, by copying everything with scp
command. The root directory had the following .htaccess
RewriteOptions inherit
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/example\.com\/forums\/content\/" [R=301,L]
I don't know how this was supposed to work, but it worked, regardless of the fact that the /forums/content/
folder did NOT exist. However, once moved to my hosting, it's stopped working, yielding a 404 error.
Since the /forums/content.php
file exists instead, I've edited the .htaccess
like this:
RewriteOptions inherit
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/example\.com\/forums\/content.php" [R=301,L]
Now it's working, with a glitch: my browser (and every other forum user browser) is caching the previous 301 redirect, so I can reach and use the forum only if I clear the browser cache (once), or if I enter the content.php
URL by hand (every time).
I've tried the workaround to add a redirect from /forums/content/
to /forums/content.php
, by adding a RewriteRule
to .htaccess
:
RewriteOptions inherit
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/forums/content/$ "http\:\/\/example\.com\/forums\/content.php" [R=301,L]
RewriteRule ^/?$ "http\:\/\/example\.com\/forums\/content.php" [R=301,L]
However it seems that rule is ignored, because the browser still gets a 404 error on the /forums/content/
directory and it does not redirect to content.php
. What am I doing wrong?