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

Anyone know how i can redirect traffic going to my site while i work on it?

Discussion in 'BlackHat Lounge' started by oni3350, Sep 25, 2009.

  1. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:
    Im wanting to work on my site.

    I want to install WP, but at the moment i have a fair bit of traffic going to it. I do not want to loose this traffic.

    Is there anyway to put a page up on my home domain that tells people or even redirects them to another page while still allowing just ME to see everything im doing so i can make adjustments while i set up the new site with WP?
     
  2. ericsson

    ericsson Elite Member Premium Member

    Joined:
    Apr 25, 2009
    Messages:
    2,642
    Likes Received:
    8,132
    Occupation:
    www
    Location:
    Swe
    Home Page:
    Hmm.. what other page for redirect them?

    use some redirection in your .htacess file ..
     
    • Thanks Thanks x 1
  3. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:
    well i have a domain name which frames my affiliate page lander.

    I want to turn this into a WP site, so i want to install WP on mydomain.com and while im working on it people will go to this page and no longer get taken to the affiliate lander page but to the new WP site.

    So i want to be able to send every other IP other than my own IP direct to the affiliate link and let ONLY ME see what im working on over at mydomain.com
     
  4. ericsson

    ericsson Elite Member Premium Member

    Joined:
    Apr 25, 2009
    Messages:
    2,642
    Likes Received:
    8,132
    Occupation:
    www
    Location:
    Swe
    Home Page:
    Hmm i donĀ“t think there are some answer to this. To tired to think.. Sorry.

    Have to go. Good Luck!

    //J
     
  5. fcuku

    fcuku BANNED BANNED

    Joined:
    Aug 17, 2009
    Messages:
    49
    Likes Received:
    238
    Why not do something like this in PHP,

    Code:
    if (!$_SERVER['REMOTE_ADDR']="your ip here") // Replace with your IP address
         header('Location: URL');
    
    or with with mod_rewrite

    Code:
    RewriteEngine On
    
    # If this aint your IP address
    RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$
    # Redirect /my.website.1 to my.website.2
    RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
    
     
    Last edited: Sep 25, 2009
  6. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:


    lol because i have no idea what you just said lol.... well i kinda do.

    Ok lets stick to the first one.

    The PHP code.

    if (!$_SERVER['REMOTE_ADDR']="1.1.1.1.1.1.1.") // Replace with your IP address
    header('THIS IS WHERE I WANT OTHER IPS TO GO???? (is this correct?)');

    So i make this into a PHP file and then upload that where?

    OR make my iframed html page into a PHP page and add this code WHERE EXACTLY?
     
  7. ericsson

    ericsson Elite Member Premium Member

    Joined:
    Apr 25, 2009
    Messages:
    2,642
    Likes Received:
    8,132
    Occupation:
    www
    Location:
    Swe
    Home Page:
    .htacess file.. mod rewrite engine on

    there are tutorial for it on an easy google search.
    :)
     
  8. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:
    So basically if i go into my .htacess file and add this code

    if (!$_SERVER['REMOTE_ADDR']="1.1.1.1.1.1.1.") // Replace with your IP address
    header('http://www.NEWLANDER.com');

    everything should work fine?
     
  9. fcuku

    fcuku BANNED BANNED

    Joined:
    Aug 17, 2009
    Messages:
    49
    Likes Received:
    238
    Two approaches and hope this helps. Open your .htaccess and use these codes, scrap my previous PHP suggestion as the following approaches work better anyway:

    Code:
    Options +FollowSymlinks 
    RewriteEngine on 
    RewriteCond %{REMOTE_HOST} !^0\.0\.0\.0 
    RewriteRule \.html$ /your_new_lander.html [R=302,L] 
    
    If you experience infinite loop between your old and new lander, then you can use the following:

    Code:
    Options +FollowSymlinks 
    RewriteEngine on 
    RewriteCond %{REMOTE_HOST} !^0\.0\.0\.0 
    RewriteCond %{REQUEST_URI} !/your_new_lander\.html$ 
    RewriteRule \.html$ /your_new_lander.html [R=302,L] 
    
    Edit: Replace, 0.0.0.0 with your IP Address ofcourse, goodluck!!!
     
    • Thanks Thanks x 1
  10. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:
    Thanks to both of you.

    I stumbled across a thread on a forum where one of you may have gotten the code from IDK. But it wasn't untill you started talking about .htaccess that i stumbled across this thread: http://codingforums.com/showthread.php?t=163329

    Otherwise i wouldn't have ever figured it out, well untill you started to explain it a little more clearly

    What i did was place
    Code:
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from 111.22.33.44
    </Limit>
    In my .htaccess and it threw up a 403 forbidden page where i then put a meta refresh on that page which then goes to my new lander.

    lol

    So thank you