Currently I have my htaccess file setup like the following: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?page=$1 [L] This allows me to do http://mydomain.com/index and have that reference to index.php?page=index I want to be able to add an admin URL in there, I assumed I could change the htaccess file to look like the following: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^admin/(.*)$ admin.php?page=$1 [L] RewriteRule ^(.*)$ index.php?page=$1 [L] However, when I go to http://mydomain.com/admin/index - I would assume that it would reference admin.php?page=index - That doesnt seem to be the case, instead it just goes to my index.php and screws up the relative links... Any suggestions on how to create the admin rule?
([^.]+) RewriteRule ^([^.]+)$ index.php?page=$1 [L] RewriteRule ^admin/([^.]+)$ admin.php?page=$1 [L]
You can just repalce those two lines. I rarly ever use RewriteCond I always start with Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / with RewriteBase being the directory of .htaccess location.