...

View Full Version : redirect



sybil6
09-21-2009, 05:47 PM
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

kbluhm
09-21-2009, 06:11 PM
Add this to your .htaccess file to display the "come back" page within the current URL, hiding the location of the comebacklater.html file:


# 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:


# If not from 123.45.67.890, redirect to /comebacklater.html
RewriteCond %{REMOTE_ADDR} !^123\.45\.67\.890$
RewriteRule .* /comebacklater.html [R=302,L]

sybil6
09-21-2009, 07:50 PM
hi, thank you. so this is apache? it wont work on a IIS server ?

kbluhm
09-21-2009, 08:06 PM
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:


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.

sybil6
09-21-2009, 09:48 PM
yep, sorry for that. thanks a lot .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum