Options +FollowSymlinks
RewriteEngine On
RewriteBase /mysite

RewriteRule ^([^/\.]+)/([^/\.]+)/?$ page.php?p=$1&name=$2 [NC,L]
RewriteRule ^([^/\.]+)/?$ page.php?name=$1 [NC,L]

The above mentioned code is designed in my .htaccess file. I would like 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

Individuals rules will work fine but when I attempt to gain access to my back-finish for that admin which URL is http://localhost/mysite/admin` it redirects the page to page.php?title=admin. It is possible to method to just limit the rule just for the page.php and never affecting another pages under sub-folder that is admin?

You could utilize a guide to prevent /admin from beein rewritten:

RewriteRule ^admin$ - [L]

Put that rule prior to the others and it'll be the sole rule that's put on /admin.

Should you add this rewrite condition before your rules, it'll only apply the guidelines when the request is not for any real file.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ page.php?p=$1&name=$2 [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/\.]+)/?$ page.php?name=$1 [NC,L]