Welcome to WebmasterWorld Guest from 35.175.120.174

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Display "Coming Soon" page in Password Protected Web Root

Want to restrict access to site but display "coming soon" page

     
1:43 pm on Apr 21, 2015 (gmt 0)

New User

joined:Apr 21, 2015
posts: 2
votes: 0


Greetings,

We want to password protect a site in development, but want people to see a coming soon page when going to the site url.

Here's the details: We have a site in development at http://example.com (not real url). The site resides in the web root (/public_html), which we have password protected.

However, when people go to http://example.com, we don't want them to have to login, but want them to see a "coming soon" page.

Is there any way to do this?

Thanks very much!

[edited by: Ocean10000 at 2:54 pm (utc) on Apr 21, 2015]
[edit reason] Fixed Links [/edit]

8:08 pm on Apr 21, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15943
votes: 890


There are various approaches. But password-protecting the entire domain, when this isn't something you plan to continue after you go live, doesn't seem the right way.

Who's going to be requesting your front page at this point? Just type-ins? Will the Coming Soon page involve any images or stylesheets that you need to allow for?

One method: Shift your development to a subdirectory such as /testing/ and password-protect that. Then make a pair of RewriteRules that look something like
RewriteCond %{REQUEST_URI} !/testing
RewriteRule (.+) /testing/$1 [L]

RewriteCond %{REMOTE_ADDR} your-own-IP-here
RewriteRule ^$ /testing/ [L]
(don't quote me, that's just off the top of my head and I think you need one more, as well as an exemption for the 403 page) so links will work as-is in your test site.
8:52 pm on Apr 21, 2015 (gmt 0)

New User

joined:Apr 21, 2015
posts: 2
votes: 0


Hi Lucy, thanks very much for the insight.

Doubt if we'll get many type-ins, and the Coming Soon page will probably have at least an image and maybe some embedded CSS.

Thanks very much for your suggestion - I received a similar response from a friend, and that seems to make the most sense for now.

All the Best,
11:52 pm on Apr 21, 2015 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11875
votes: 246


as a general rule i would always put the development site on a subdomain that is password protected with 401 status code using HTTP Basic Authentication or an equivalent.

in order to prevent the "coming soon" page from being indexed i would configure requests for the main domain to return a 503 status code.
i would also specify in the main domain's configuration a custom 503 error page that says "Coming Soon!" or whatever.

(if configuring a subdomain is not an option, you can instead use a subdirectory as lucy24 suggested)
4:04 am on Apr 22, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:10599
votes: 1128


Move the dev site to some location OTHER than root. Have only your index/coming soon page and a custom 404/coming soon and nothing else that is not password protected (ie, in a folder below root, or a subdomain).

All too often in dev production things get crawled prematurely and one starts with a strike against by having to deindex from the get go what was discovered elsewhere... and those discoveries can come from emails, inadvertent links from other sites, etc.

The domain name itself is your "coming soon".