Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: redirect

  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    399
    Thanks
    33
    Thanked 7 Times in 7 Posts

    redirect

    hello

    i would like to update my wordpress blog, but i want to put in place a re direction so all the people are redirected to a page that says"come back later", but not myself my ip must not be redirected as i need to be watching the changes i do. how can i do that?
    thanks

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Add this to your .htaccess file to display the "come back" page within the current URL, hiding the location of the comebacklater.html file:
    Code:
    # If not from 123.45.67.890, show /comebacklater.html
    RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.890$
    RewriteRule .* /comebacklater.html [L]
    To physically redirect to the "come back" page:
    Code:
    # If not from 123.45.67.890, redirect to /comebacklater.html
    RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.890$
    RewriteRule .* /comebacklater.html [R=302,L]
    Last edited by kbluhm; 09-21-2009 at 05:15 PM.

  • #3
    Regular Coder
    Join Date
    Jul 2006
    Posts
    399
    Thanks
    33
    Thanked 7 Times in 7 Posts
    hi, thank you. so this is apache? it wont work on a IIS server ?
    Last edited by sybil6; 09-21-2009 at 07:04 PM.

  • #4
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Sigh. Is this for IIS? You failed to mention that in your original message... would have been helpful.

    Place this code at the very top of your root index file:
    PHP Code:
    if ( '123.45.67.890' != $_SERVER['REMOTE_ADDR'] )
    {
        
    readfile'comebacklater.html' );
        exit;

    Make sure comebacklater.html is in the same folder as the index file.
    Last edited by kbluhm; 09-21-2009 at 07:09 PM.

  • Users who have thanked kbluhm for this post:

    sybil6 (09-21-2009)

  • #5
    Regular Coder
    Join Date
    Jul 2006
    Posts
    399
    Thanks
    33
    Thanked 7 Times in 7 Posts
    yep, sorry for that. thanks a lot .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •