How can I temporarily hide website for a couple of days while I still work on my website?

Posted December 9, 2016 3.8k views

I just want to disable my website for a couple of days.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

You could use service nginx stop or service apache2 stop to turn off your web server.

As @gparent said, the easiest way is to just shut down your web server. Now if you need to access your site while working on it but don’t want anyone else to I sometimes find it handy to point your DNS record elsewhere and set up an entry in the hosts file on my local computer so the domain works for me but nobody else. The hosts file can be found in /etc/hosts on Linux and Mac and in C:\Windows\system32\drivers\etc on Windows. The format is just the domain name and an IP address in the order shown in the file. Just make sure to delete the entry when you’re ready to go live or you may end up running into confusing results trying to troubleshoot a problem in the future.

You can set a firewall rule to allow only from your IP address