This is my current .htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA]
Now I want to route all request for js/css to combine.php(for minyfying), so I Tried,
Trial 1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA]
RewriteRule ^css/(.*\.css) /library/combine.lib.php?type=css&files=$1
RewriteRule ^js/(.*\.js) /library/combine.lib.php?type=javascript&files=$1
Error : All request(css/js) are routed to index.php
Trial 2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^css/(.*\.css) /library/combine.lib.php?type=css&files=$1
RewriteRule ^js/(.*\.js) /library/combine.lib.php?type=javascript&files=$1
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA]
Error: 500 internal server error
How to accomplish all request(js/css) to go to combine.php, without disturbing the existing rewrite rules ?