Answer the question
In order to leave comments, you need to log in
Need help with .htaccess on RewriteRule. How to add an exception?
Already worn out, there is a stub "the site is temporarily down, come back later ..." if the file unavailable/unavailable.php is located at the address, it works. In any other cases, returns index.php.
.htaccess at the root is like this. The problem is that it cuts everything in the /unavailable js directory, and css c jpg, gives only pure unavailable.php, how can I put all these extensions into an exception?
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/unavailable/unavailable.php -f
RewriteRule ^.* unavailable/unavailable.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Answer the question
In order to leave comments, you need to log in
Hello.
Try like this
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/unavailable/unavailable.php -f
RewriteCond %{REQUEST_URI} !^/unavailable
RewriteRule ^.*$ unavailable/unavailable.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question