Reputation: 13
I created .htaccess file:
RewriteRule ^([a-zA-Z]{0,2})/(.*)/(.*)$ index.php?lang=$1&ctrl=$2&method=$3 [L]
RewriteRule ^([a-zA-Z]{0,2})/(.*)$ index.php?lang=$1&ctrl=$2 [L]
RewriteRule ^(.*)/(.*)$ index.php?ctrl=$1&method=$2 [L]
RewriteCond %{QUERY_STRING} !ctrl
RewriteRule ^(.*)/?$ index.php?ctrl=$1 [L]
and I need it to ignore rewriting included css files.
Thank's for you answer :)
Upvotes: 1
Views: 154
Reputation: 785316
Keep your rules like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([a-zA-Z]{0,2})/([^/]+)/([^/]+)/?$ index.php?lang=$1&ctrl=$2&method=$3 [L,QSA]
RewriteRule ^([a-zA-Z]{0,2})/(.*)$ index.php?lang=$1&ctrl=$2 [L,QSA]
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?ctrl=$1&method=$2 [L,QSA]
RewriteCond %{QUERY_STRING} !ctrl
RewriteRule ^([^/]+)/?$ index.php?ctrl=$1 [L,QSA]
Upvotes: 1
Reputation: 32921
You can do this before your other lines I believe.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Here's a tiny bit more information on it: https://stackoverflow.com/questions/15879029/don%C2%B4t-understand-rewritecond-request-filename-f-and-d
Upvotes: 1