Welcome to WebmasterWorld Guest from 54.167.155.147

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Ya3rq

   
8:30 pm on Apr 12, 2013 (gmt 0)



Yet
Another
301
Redirect
Question

I just appeared on page 1 for a certain keyword. One one of my competitors is now calling me on the phone and harassing me.

Is it possible to redirect JUST his IP address (of which I have) to another website (of my choosing) when he attempts to visit my website?

If so, can you help me out with the .htacccess code?

I have searched high and low in Google (mostly low) and the best query I could come up with to describe my problem was:

"how to 301 redirect a single ip address"

and the websites shown did not prove worthwhile.


So I have attempted to do my homework before coming on here and bothering you good people.


Thanks if you can help.
8:32 pm on Apr 12, 2013 (gmt 0)



Edit: The best I could do is:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^121\.121\.11\.121
RewriteRule ^(.*)$ [my-domain.com...] [R=301,L]


But wasn't sure if that would work properly and not kill my SEO.

This is JUST to mess with the other guy. Nothing more.
9:13 pm on Apr 12, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Ouch! HTTP_HOST is your own domain name, not the other guy's IP address. You want REMOTE_ADDR :)

Does that other domain-- the one you're redirecting to-- have the exact same URL structure as your first domain? If not, there's no point to capturing anything in the request.
4:50 am on Apr 13, 2013 (gmt 0)



Hi Lucy,

Yes, the other domain is www.website.com.

I just want to pass this trouble maker off to a "funny" website (that is not appropriate for me to post here).

Ok, so I'm completely lost here.....
7:58 am on Apr 13, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Er, not sure what the "Yes" is in reply to. I only asked one yes/no question, and its answer would appear to be No. :) Unless your "funny" site is a page-by-page parody of your real site, which seems a bit far-fetched.

Take a moment to read the post about using "example.com". It will save the moderators a bit of aggravation; they've got enough to do, weeding out the spam posts that tend to show up around this hour of the night.

Oh, and when I said
HTTP_HOST is

I meant: The "HTTP_HOST" condition looks at your own domain name. Any other value in this slot-- such as the other guy's IP address-- will always fail. If you want to test against his IP, use the "REMOTE_ADDR" condition.

Your original RewriteRule is syntactically correct, it's just using the wrong values in the wrong places ;)