views:

171

answers:

6

Is it possible to make the website unavailable while editing it, while online?

If so, what is the method called and how is it done?

I have a webhosting company so it's not my own server!

Thanks

+6  A: 

Typically, people use the .htaccess to password protect it until you are ready to show it to the world

Here is a link to an article with instructions

http://www.elated.com/articles/password-protecting-your-pages-with-htaccess/

DrewM
ok, how is this done... what should I serach for on google?
Camran
there are a couple of additional articles if you search for htaccess password
DrewM
If you can't do a series of command-line steps to create the basic auth hash, there's an online (javascript-based) .htaccess creator: http://www.htaccesseditor.com/en.shtml#a_basic (Careful! the utility doesn't appear to post your data (conventionally or AJAX), but even so you can't be too cautious. Start a private browsing session (Firefox), load page linked above, disable your internet connection, generate the code with it, close page, clear all cookies, leave Private browsing.
micahwittman
+1  A: 

Or, if it's ASP.Net - place a file called app_offline.htm in the site root.

Alex DeLarge
More correctly; "If the web server is IIS".
rally25rs
+1  A: 

If you are uploading a new version of the site you can create a symlink in the place of the root directory and then switch that when the site's ready. You can also switch the symlink back to the previous version if something goes wrong.

Joe
+1  A: 

You can make an .htaccess file like this :

RewriteCond $1 !offline.html$ 
RewriteCond %{REMOTE_ADDR} !^your_ip_adress
RewriteRule ^(.*)$ http://www.mydomain.com/offline.html [R=302,L]
Delapouite
+2  A: 

I had the same issue, I just put up a "coming-soon.html" page and redirected everyone without my IP there via htaccess, here's the question on SO: Want to redirect all visitors except for me [.htaccess]

Andrew G. Johnson
+1  A: 

Simply put the files in a new directory and don't tell anybody else the name of the directory. (Or you can tell it to some beta testers if you like.)

When the pages are ready and tested, just move the files into the normal place (after moving the old existing files into backup directory). This way, you always have a working site online.

But generally, it is better to develop the web site on your local computer, not online.

PauliL
+1 - it's easy to setup Apache and PHP
kdgregory