I have an htacess file for apache that isn’t working properly.
I have a default cactch-all that grabs all requests however it’s still catching the matched URL above it (ajax/*). I thought that condition to match urls not containing ajax would stop it but it isn’t.
RewriteRule ^ajax/(.*)$ process_lite.php [QSA,L]
RewriteRule ^resources/(.*)$ resources/$1 [L]
RewriteCond %{REQUEST_URI} !\.(css|jpg|js|gif|png)$
RewriteCond %{REQUEST_URI} !^ajax
RewriteRule ^(.*)$ process.php [QSA,L]
Can someone help me out?
It’s probably because the first rule matches
/ajax/requests and rewrites it to/process_lite.php, thus theRewriteCond %{REQUEST_URI} !^ajaxdoesn’t match since the URI is now process_lite.php. The regular expression you use won’t match anything anyways because REQUEST_URI variable will start with a leading slash. You can try changing the condition to:Additionally, the “resources” rule doesn’t seem to do anything except end rewriting, you could change it to this if that’s the goal: