Answer the question
In order to leave comments, you need to log in
Why doesn't rewrite work in htaccess when there is an existing directory?
Hello. Tell me please. There was a problem. If the directory exists, then the redirect in the .htaccess file is not performed
. eg
RewriteRule ^news/$ news.php [L]
is not executed if there is a news folder, there is no folder, no problem.
Maybe somewhere in the apache settings the problem.
Help me decide please.
Answer the question
In order to leave comments, you need to log in
Check if something like
RewriteCond %{REQUEST_FILENAME} -d is above
And if another RewriteRule c [L] doesn't fire before
I only have
RewriteRule ^news/$ news.php [L]
The rule doesn't work if the directory exists. In the logs, it goes to the actual location of the folder. Doesn't work like for example with MultiViews, those. the rule set by MultiViews is executed, and the mod_rewrite rules are ignored.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question