Block All Access to your Website Using .htaccess

  Print

Block All Access to your Website Using .htaccess

First, if you're unsure how to access your .htaccess file click here for a guide.

Once in there, just copy and paste this code into the top of the file then save it:

order deny, allow

deny from all

allow from 127.0.0.1

That's it :) it should work straight away though you may have to refresh the page in case it's cached by your browser.

You can also allow yourself only to have access. Just use the a website like http://whatip.me/ to get your IPv4 address then add it in like this:

order deny, allow

deny from all

allow from 127.0.0.1

allow from 124.25.67.217


Did you find this article useful?  

Related Articles

© Crucial