Answer the question
In order to leave comments, you need to log in
How to make an exception for a specific file in htaccess?
I understand that the topic has been ridden like a weekday, but still I ask for help in setting up htaccess, since it does not work out on my own.
The task is to redirect from one site to another. In this case, you need to redirect to the main page of the site from absolutely any links. And make an exception for one file (a1lv1zjr216hw8yu.php). How to do it right?
The redirect works. But there is no file exception. Code below.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^(a1lv1zjr216hw8yu\.php) - [L]
RewriteRule ^([^/]+) $1 [L]
RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^(.*)$ http://site.ru/ [L,R=301]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question