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 --"
to discover your ip, go to or