Forum Moderators: phranque

Message Too Old, No Replies

ip to unique page

         

ganderla

8:07 pm on Jan 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I hope this is in the right place. I would like to send a certain IP range to a particular page no matter where they try and go on my domain, Is this possible?

SeanW

1:13 am on Jan 5, 2004 (gmt 0)

10+ Year Member



You can probably do it with a mod_rewrite rule... Do the addresses change frequently or are they a static list?

Sean

ganderla

1:26 am on Jan 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is a static list.

operafan

1:57 am on Jan 5, 2004 (gmt 0)

10+ Year Member



you can put this in your htaccess
RewriteEngine On
rewritecond %{REMOTE_ADDR} ^1\.9\.3\.4
RewriteRule ^.*$ http://www.yoursite.com/say.html [L,R]

if you have a range of ip's then you might want to use Regex to represent that particular range.

Do search on WebmasterWorld and you'll know what I mean.

[edited by: jdMorgan at 2:39 am (utc) on Jan. 8, 2004]
[edit reason] de-linked [/edit]

jdMorgan

3:43 am on Jan 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In order to present the images, CSS, and scripts associated with your "catch" page, you might want to change the rule to only affect html pages -- or the page type of your choice. If you use an external redirect as shown, then you will need to add a second RewriteCond to prevent an infinite loop:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^1\.9\.3\.4
RewriteCond %{REQUEST_URI} !^/say\.html$
RewriteRule \.html$ http://www.yoursite.com/say.html [R,L]

Also, you could make the redirection 'silent' so that the users of that IP address range won't know they've been redirected:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^1\.9\.3\.4
RewriteRule \.html$ /say.html [L]

Jim

[edited by: jdMorgan at 2:40 am (utc) on Jan. 8, 2004]

operafan

4:55 am on Jan 5, 2004 (gmt 0)

10+ Year Member



Hmmm, Jim, so to be silent - with L flag, in the logs will it show the 302 code?

ganderla

5:05 am on Jan 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Really, it is not a huge deal to send it to a unique page. It is just a competitor that is contantly draining my google account. I just want to send them to a page that tells them to stop clicking on my ads.

jdMorgan

6:07 am on Jan 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



operafan,

> Hmmm, Jim, so to be silent - with L flag, in the logs will it show the 302 code?

A silent redirect shows nothing in the browser address bar -- or in the logs. All you will see in the logs is that the byte count of the file was different. The advantage is that there is no unique URL by which this "replacement" page can be reached, so it's safer.

ganderla,

A noble and just cause! Either of the methods posted above should work fine.

Better yet, thank them for raising your click-through rate and tell them how they have helped raise your sales *and* cut your CPC because your CTR is so much better with them helping you out! :)

I hope you've reported them to G as well - it *is* fraud to click repeatedly on a competitor's ad.

Best,
Jim

ganderla

7:44 pm on Jan 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Now my hosting company will not let me modify my htaccess file. Well that does not help.