I hope you can help, I’ve tried for hours to understand mod rewrite but I just seem to be getting no where.
What I’m trying to achieve is a mod_rewrite that takes the whole url as a var unless it begins with something like ‘/images/…..’ etc
the idea being that all my pages are in a table and then found and processed from then on.
Currently I have
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?url=$1
This works to a point,
any URL I can get using $_GET which is great, but I don’t want to use request_filename conditions,
id like in the rewrite rule to exclude if url == ‘/images/’ or == /css/ etc
Hopefully this makes sense, and i’m sure this is easy.
Also if you have any thought about how to improve the way im trying to achieve this that’d be of use then please let me know.
Cheers!
currently got
RewriteEngine On
RewriteBase /
RewriteRule ^/images/ - [L]
RewriteRule ^/css/ - [L]
RewriteRule (.*) index.php?url=$1
thanks to Alexander but $_GET[‘url’] == ‘index.php’
Place a rule for those directories first and use the
[L]flag.An untested alternative could be also: