Solved

Redirect users to 'under construction', but allow client (and myself) to go to root domain and see website

Posted on 2008-10-28
2
187 Views
Last Modified: 2012-08-13
I create blog/CMS websites for clients based on open source CMS. I don't have the money (or the need) for a testing server as I develop the sites.

What I would like to do, is be able to completely develop the website on the root domain, so that when I go to the website address, ie www.example.com, I can see the website in progress. Also, I'd like my client to be able to go there too.

However, besides myself and my client, I don't want anybody else to be able to see the construction. I'd like other users to be shown a 'under construction' page.

I have no idea how to go about this.
0
Comment
Question by:dainberrett
2 Comments
 
LVL 11

Accepted Solution

by:
spoxox earned 500 total points
ID: 22823692
Short of adding a (more difficult) sign in page, etc....

You can try this weak workaround:

Your web server will serve  a variety of different pages by default eg
index.htm
index.html
index.php
default.asp

etc. The specifics are a configuration issue on the server. The order is important!

Create a "fake" index.htm (if that's the first page the server looks for - trial and error if it's a commercially hosted server) that has your "under construction" message.

Make the "real" root of your site something else, e.g. test.htm. This is the page you'll surf to. Later, you'll either rename this page or change your index.htm to automatically redirect to it.
0
 
LVL 82

Expert Comment

by:hielo
ID: 22823706
1. If you and your client have a static ip, then you can check that IP and redirect users to "Under Construction" if request does not originate from those ips:
<?php

switch( strval($_SERVER['REMOTE_ADDR']) )
{
   case "999.999.999.999"://client ip
   case "888.888.888.888"://your ip
        //these are valid IPs so just continue
        break;

   default://all other requests come from invalid IPS
   header("UnderConstruction.php");
   exit;
}

2. You can set up some authentication page and grant access to site content only if user authenticates successfully
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question