Merlin
Expert Member
.htaccess - redirect exclusions (SORTED!)
Hi all,
I finally got my 'site up and running the .htaccess that I wanted - but now I'm also hosting a friend's domain.
I've gotten all of that working...
Here is my original .htaccess
RewriteCond $1 !^phpinfo\.php$
RewriteCond $1 !^robots\.txt$
RewriteRule (.*) http://mydomain.com/sample/$1 [R,L]
That redirect all requests to the 'sample' folder, EXCEPT for phpinfo.php and robots.txt
The problem is that is now also requesting www.friendsdomain.com to the 'sample' folder.
I've put some temp' instructions in place to get it working for the moment but I specifically want to use the code above if possible.
How do I a domain exclusion to that code, please?
Thanks, Nic
Hi all,
I finally got my 'site up and running the .htaccess that I wanted - but now I'm also hosting a friend's domain.
I've gotten all of that working...
Here is my original .htaccess
RewriteCond $1 !^phpinfo\.php$
RewriteCond $1 !^robots\.txt$
RewriteRule (.*) http://mydomain.com/sample/$1 [R,L]
That redirect all requests to the 'sample' folder, EXCEPT for phpinfo.php and robots.txt
The problem is that is now also requesting www.friendsdomain.com to the 'sample' folder.
I've put some temp' instructions in place to get it working for the moment but I specifically want to use the code above if possible.
How do I a domain exclusion to that code, please?
Thanks, Nic
Last edited: