PDA

View Full Version : htaccess allow one ip only and deny/block all with custom message



Fli
04-06-2017, 11:48 AM
How to allow access to a website only one person/one IP and block/deny all other?

I found this possible solution. Add following to the .htaccess file residing in your website root folder


Order Deny,Allow
deny from all
allow from YourIPHere
ErrorDocument 403 "Site was disabled in .htaccess for public browsing. Please try again later or contact admin on e-mail YourEmail -- Gmail.com"


to discover your ip, go to http://whatismyip.org or http://myip.ms