I've got a regexp condition in my htaccess. I wish to redirect all parameters in $_GET['params'] except css &lifier js (they are folders) however the $_GET['params'] is empty :(

For instance basically type : mydomain.com/its/an/example Then $_GET['params'] = /its/an/example

But when i type : mydomain.com/js/its/an/example It should be read just like a folder.

Here is my code :

RewriteRule /!(css|js)(.*) /index.php?params=$1 [L]

If you are wanting the (.*) part use $2

Or I guess you could utilize (?:css|js) which may turn it into a passive group.

Okay i discovered... You don't need to catch whether it's a folder or otherwise, i filter this using the native !-f and !-d :

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php?params=$1 [L]

)