Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
permanently redirect specific IP request for single page
I’m trying to redirect a particular IP from a particular section to another page. I know I can use the Deny
rule but for now they haven’t been that bad. A search on the net returned the following but it returns a 500. Is there another way?
# permanently redirect specific IP request for single page
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} xxx\.xx\.xxx\.xx
RewriteCond %{REQUEST_URI} /section/ $
RewriteRule .* /no.html [R=301,L]
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: permanently redirect specific IP request for single page
Does it work if you zap the space before $
on line 5?:
RewriteCond %{REQUEST_URI} /section/$
Last edited by gaekwad (2015-02-08 20:43:52)
Offline
Re: permanently redirect specific IP request for single page
gaekwad wrote #288102:
Does it work if you zap the space before
$
on line 5?:
That fixed the 500 but also revealed that the rule is not working. Maybe I’ll just block him from the whole site.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: permanently redirect specific IP request for single page
Try:
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} xxx.xxx.xxx.xxx
RewriteRule !^no.html$ /no.html [R,L]
Offline