How to block all visitors in your website except yourself via .htaccess file? [Important| Revised 2019]
Hey Friends!!! If you want to deny access to your website to everyone except yourself, then you can place this codes in your .htaccess file
order deny,allow
deny from all
allow from 106.219.176.31
Steps to block all visitors in your website except yourself via .htaccess file: [Updated May 2019]
- step::1 Login to your cPanel
- step::2 Go to File Manager section and click on Public_html
- step::3 Now find .htaccess file inside public_html and if you don’t have .htaccess file you can simply create one.
- step::4 Right click on .htaccess file to edit
- step::5 Now edit the file using the above mentioned code
This code will generate 403 forbidden error and deny access to your site to everyone while still allowing yourself or another specific IP address to visit it.
Hope this helps you!!!
Thanks for Reading!!!!