Options +FollowSymlinks
RewriteEngine On
RewriteBase /mysite
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ page.php?p=$1&name=$2 [NC,L]
RewriteRule ^([^/\.]+)/?$ page.php?name=$1 [NC,L]
The above code is written in my .htaccess file. I want my URL from:
http://localhost/mysite/page.php?p=categoryname&name=article_title
http://localhost/mysite/page.php?&name=articel_title
to:
http://localhost/mysite/category/article_title
http://localhost/mysite/article_title
Those rules are working fine but if I try to access my back-end for the admin which URL is http://localhost/mysite/admin` it redirects the page to page.php?name=admin. Is there a way to just limit the rule only for the page.php and not affecting the other pages under sub-folder which is admin?