Currently my website is under maintenance. I want to be the only person who's able to access/view the website online until I finish maintenance. How to set restrictions to others ? I hate stalkers.
If your website is only temporarily "under maintenance" and has already been live and indexed by search engines then you should consider returning a "503 Service Unavailable" HTTP response code with perhaps a
The 503 response is specifically for situations when the site is "down for maintenance" and can help lessen the effect any downtime might have on your search engine ranking.
This is easily achieved using
To achieve something like this in htaccess:
Only the IPs 22.214.171.124 and 126.96.36.199 will be allowed access. Then to send an unconditional
(This could be sent conditionally based on the value of an environment variable for instance.)
However, personally I tend to pass the date/time directly to my error document and allow my script to set the header conditionally and display a meaningful message to the user at the same time (this would also be reqd if you didn't have
I can see that you selected "cpanel" as a tag. In your cPanel you should have an option to password protect directories. It looks like this:
There you can setup a username and password for your website root. In this way only people that have the right credentials can see the site.