So I’ve currently got all my URL’s redirecting to index.php with this in my .htaccess:
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
However, I need URLs such as http://localhost/Portfolio/Serene/Assets/css/style.css to not redirect, but I’m not sure how?
I’d really appreciate any help,
Cheers.
EDIT: Alternatively, I could tell the htaccess to not redirect any .js, .css, image files, etc, but again, I’m not too sure how to do this?
Thanks!
EDIT2: I could also redirect anything ending in a .php or a path (such as /Portfolio/) to index.php, I have a feeling this may be easier.
EDIT3: Success, final code:
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT} !-f
RewriteRule !\.(js|ico|gif|jpg|png|css|html|swf|flv|xml)$ index.php [QSA,L]
Here’s a another way to do it:
images, robots.txt won’t be rewritten to index.php. Just add your directories/files.
Hope that helps!