A
A
Alexander Stepanov2017-01-11 22:40:25
htaccess
Alexander Stepanov, 2017-01-11 22:40:25

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 question

Ask a Question

731 491 924 answers to any question