It is possible to method using mod_rewrite to possess a rule which fits index.php (or whatever page under consideration) at "this" degree of your directory structure, although not any index.php inside a subdirectory below it?
http://www.domain.tld/index.php == should match, while
http://www.domain.tld/admin/index.php == shouldn't match
I.e., I am searching for a "don't descend" argument, try not to be aware of right phrase to find within the documentation. Observe that we might not be speaking about only a /admin, but ANY subdirectory, which the page we are attempting to match might not be at the very top level such as this example, but instead, in the same level because the htaccess file, wherever it's.
what about this:
RewriteRule ^index.php$ index.php # match RewriteRule ^(.*)/index$ $1/index.php # not match
You just need to supply exact pattern, anything:
RewriteRule ^index\.php$ new_url.php [L]
^index\.php$ will ONLY match
index.php in current folder (exactly the same folder where .htaccess file is) and never every other location (
^ means start of the string while
$ means finish from the string).