V
V
Valery Nistratov2016-02-13 23:59:01
htaccess
Valery Nistratov, 2016-02-13 23:59:01

How to set up a redirect by IP through .htaccess and get rid of the "looping"?

Good evening.
All day I was tormented with the issue of redirecting one IP through .htaccess . But something always didn't work. Once a redirect appeared, but it turned out that the old cache was superimposed on the new rules (I can’t imagine how).
The point is. Lines:
RewriteCond %{REMOTE_ADDR} ^109.232.106.198
RewriteCond %{REQUEST_URI} !^{HTTP_HOST}/svyaz-s-posetitelyami/uvazhaemyj-veb-master.html$
RewriteRule ^/$ /svyaz-s-posetitelyami/uvazhaemyj-veb -master.html [R=301,L]
Practically worked (just lay down after an unsuccessful recording and opened the correct page several times).
But they don't work. I need to redirect one visitor by his IP always to one page on the site. But the main problem is that without the second line, the browser reports that it is looping. Which is logical, because the redirect page is on the same site.
Perhaps someone can tell me where I made a mistake in the records? What sign did you miss?

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