开发者

How to make website unavailable for others while developing it online?

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

If so, what is 开发者_Python百科the method called and how is it done?

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


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/


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]


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


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.


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] 


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜