Forum Moderators: phranque
Options -Indexes
Options +FollowSymlinksRewriteEngine on
RewriteRule ^admin/(.*)$ admin_$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
Everything works fine except for admin part.
When admin/any_text comes in url, it routes to admin_any_text. but i want resitriction in some cases as i have folder structure for admin as:
-admin
--js
--themes
---default
----images
----css
Instead of:
RewriteRule ^admin/(.*)$ admin_$1 [L]
which matches any (.) character after the "admin/" bit, try:
RewriteRule ^admin/([^/]*)$ admin_$1 [L]
this will match "admin/" and then any characters as long as they don't contain a '/'. This should eliminate rewrites to admin/js/, admin/themes/ &c.