I’m trying to do what I’ve said above but I am getting a looping error and sometimes a 500 error!
What I want is for users requesting the root ‘Home’ page of the site to be redirected to /Welcome – UNLESS they are already browsing the site.
Here’s my code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^mydomain\.co\.uk$ [N]
RewriteCond %{REQUEST_URI} /index.php [N]
RewriteRule ^$ /Welcome [L]
You’re probably getting the 500 error because the
[N]isn’t a validRewriteCondflag, are you thinking of[NC](no case)?Additionally, you have a condition that directly contradicts the rule’s match:
Says the URI must have a
/index.phpin it. While the rule itself:Says the URI must match
^$which means it must be exactly/. And/will never be/index.php, so the rule is instantly invalid. Maybe you’re thinking of either/or?This will match the referer without case against
mydomain.co.uk, and rewrite either/or/index.phpto/Welcome