I have an htaccess rewrite setup in my PHP application to route files via the bootstrapper file. In essence, the goal is to take a URL such as www.domain.com/view/key/value
You should move your new rule atop the RewriteCond block:
RewriteRule ^/?ajaxDispatcher.php$ - [L]
Otherwise the RewriteConditions don't cover the extensions RewriteRule anymore, for which I assume they are intended.
Another alternative is turning it into another RewriteCond of course:
RewriteCond %{SCRIPT_NAME} !ajaxDispatcher
Or injecting it as assertion into the final RewriteRule (?!ajaxDispatcher.php)
.
The ordering thing is best explained on Serverfault: https://serverfault.com/questions/214512/everything-you-ever-wanted-to-know-about-mod-rewrite-rules-but-were-afraid-to-as
If you remove the ajaxDispatcher.php
line from the code you show, it should work - because of the !-f
and !-d
rules, requests to files that actually exist will be excluded from the rewrite ruke.