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 sit
You're probably getting the 500 error because the [N]
isn't a valid RewriteCond
flag, are you thinking of [NC]
(no case)?
Additionally, you have a condition that directly contradicts the rule's match:
RewriteCond %{REQUEST_URI} /index.php
Says the URI must have a /index.php
in it. While the rule itself:
RewriteRule ^$ /Welcome [L]
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?
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^mydomain\.co\.uk$ [NC]
RewriteRule ^(index\.php)?$ /Welcome [L]
This will match the referer without case against mydomain.co.uk
, and rewrite either /
or /index.php
to /Welcome