Your web host is wrong. The order of ruleset processing is:
- pattern in
RewriteRule
is tested (that will populate the $N
references with values)
- associated
RewriteCond
conditions are tested (if present)
Only if the pattern matches the current URL path and the associated condition is fulfilled, the pattern is applied.
So in your case the pattern (.*)
is tested on the current URL path js/main.php
(without local prefix /
). It matches ($0
=js/main.php
, $1
=js/main.php
) so the three associated conditions are tested in the order they appear:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|img|css|js|robots\.txt)
Assuming that the requested URL path /js/main.php
does not refer to an existing file or directory, the first conditions are both true. But the third one will evaluate to false as $1
=js/main.php
and the pattern ^(index\.php|images|img|css|js|robots\.txt)
matches (^js
branch) js/main.php
. So the condition is not fulfilled and the rule is not applied.