Reputation: 781
This exclude CSS/JS/Images from original url. Anyone know how to solve this problem ?
.htacess:
RewriteEngine on
RewriteRule %{REQUEST_FILENAME} !-d
RewriteRule %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L]
PHP:
$splitarray = explode('/',$_GET['uri']);
Upvotes: 2
Views: 3046
Reputation: 143906
Try:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_URI} \.(js|css|jpe?g|gif|png|bmp|ico)$ [NC]
RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L]
So this will route through index.php
if the request isn't for an existing directory and, the request isn't for an existing file OR the request isn't for a file ending with js, css, jpeg, jpg, gif, png, bmp, ico.
Upvotes: 3