1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How Can I Redirect a Range of Visitor IPs to a Different Domain?

Discussion in 'Black Hat SEO' started by -Jericho-, Aug 17, 2012.

  1. -Jericho-

    -Jericho- Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    Jan 10, 2010
    Messages:
    2,849
    Likes Received:
    1,704
    Location:
    Stalking My Ex-Wife
    Anyone know how to do this?

    I just found this. Would it work? And how do I do a range?

    Code:
    # permanently redirect specific IP request for single page 
    RewriteEngine On 
    RewriteBase / RewriteCond %{REMOTE_HOST} xx\.xxx\.xxx\.xxx
    RewriteCond %{REQUEST_URI} http://www.main-site.com
    RewriteRule .* http://www.other-site.com [R=301,L]
     
    Last edited: Aug 17, 2012
  2. ReALeST

    ReALeST Power Member

    Joined:
    May 16, 2012
    Messages:
    584
    Likes Received:
    399
    Have u tried mod_rewrite?

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REMOTE_ADDR} ^85\.204\.$ [OR]
    RewriteRule ^(.*)$ clientA.html [R,L]


    RewriteCond %{REMOTE_ADDR} ^95\.178\.124\.$ [OR]
    RewriteRule ^(.*)$ clientB.html [R,L]


    </IfModule>

    This will turn ANY page into the clients-page. You might want to change the ^(.*)$ part to (for example) clients.html -> that way only the client-page gets rewritten based on the IP address.
     
    • Thanks Thanks x 1