this is my current htaccess and i use mod_rewrite
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !^/?admin/.+$ index.php [L]
RewriteRule ^admin/(.*)$ admin/index.php [L]
I need to rewrite admin requests to the admin/index.php
and other requests to /index.php.
example:
localhost/example to /index.php
localhost/foo/bar to /index.php
localhost/admin/login/ to admin/index.php
localhost/admin/pages/ to admin/index.php
above rules working fine but it apply to css styles or javascripts too. that means admin/js/jquery.js will rewrite to admin/index.php too(the file path exist). what I’m missing?
You need to duplicate the 2 conditions, which only apply to the very next
RewriteRule: