: Displaying a "coming soon" image to users whilst I work on website redevelopment Possible Duplicate: 301 redirects for all except me I've been developing a new version of my website
Possible Duplicate:
301 redirects for all except me
I've been developing a new version of my website for a while now, on a different directory to my currently-live website.
Shortly I'll be ready to move this directory to root and do a mass search and replace on the database dump.
However, for the short period whilst I take the old files offline and put the new site in place - and test it to make sure everything is working correctly - I'd like to put up a "coming soon, version 2 of the website!" image to all users apart from myself.
When I access the website, I want to be able to see everything as usual so that I can work on it.
What's the best way to go about this?
Thanks in advance,
More posts by @Moriarity557
3 Comments
Sorted by latest first Latest Oldest Best
Why not develop on a local server and when ready commit it to your live site? Are you making significant database changes or are you only doing search and replace to update the path from your sub folder development area to the root folder? Using redirects and coming soon pages might affect your rankings in Google. If you can avoid it you should and find another way to update without having to redirect everyone with a coming soon page.
Think I've found a link on here which I should've noticed in the first place:
301 redirects for all except me
I suspect this will do the trick for me perfectly.
Based on this example you could use php to show one page to your ip address and another to everyone else.
PHP - this sends a 302 by default
<?
$visitor = $_SERVER['REMOTE_ADDR'];
if (preg_match("/192.168.0.1/",$visitor)) {
header('Location: www.yoursite.com/thank-you.html'); } else {
header('Location: www.yoursite.com/home-page.html'); };
?>
Htaccess 1
You can also achieve the same thing with htaccess, customising the 403 error page as you like.
order Deny,Allow
Deny from all
Allow from my.ip.add.ress
ErrorDocument 403 /forbidden.html
Htaccess 2 Rewrite Rule with 503 code
RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} !=503
RewriteCond %{REMOTE_HOST} ^192.168.0.1
ErrorDocument 503 /redirect-folder/index.html
RewriteRule !^s/redirect-folder$ /redirect-folder [L,R=503]
Status 301, 302 or 503
Also remember with this and other types of redirect that you should use a 302 redirect for temporary re-directions rather than a 301 which signals to Google it's a permanent re-direction you can also use a 503 'temporarily down' code to signal to search engines that they shouldn't index your holding page.
Check the list of status codes to choose the most appropriate.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.