Hi All,
I'm trying to do some URL rewriting - but for some reason it's not working as I expected (I've probably missed something really simple!).
I have two sites - www.domain.local and admin.domain.local. Using the below .htaccess file, the public site rewriting is fine, but the admin site isn't working as expected, as it is being picked up by the first condition (even though echoing out the HTTP_HOST shows I'm looking at the admin site domain).
Options -MultiViews
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
## Force www
RewriteCond %{HTTP_HOST} ^domain\.local$ [NC]
RewriteRule ^(.*)$ http://www.domain.local/$1 [R=301,L]
## Public site rewrites
RewriteCond %{HTTP_HOST} ^www\.domain\.local$ [NC]
RewriteRule ^(home)(/)?$ /index.php [NC]
RewriteRule ^([a-z0-9+-]+)(/)?$ /$1.php [NC,L]
## Admin site
RewriteCond %{HTTP_HOST} ^admin\.domain\.local$ [NC]
RewriteRule ^([a-z0-9+-]+)(/)?$ /manage/$1.php [QSA,L]
What am I doing wrong?
Many thanks, Kev