Block All Website Visitors Except My IP Using htaccess

First you will want to determine your IP address.
Google will display your IP Address at this link:

Create a file named .htaccess with the CPanel File Manager in the public_html folder or Add-on Domain folder if it does not already exist.

At top of the .htaccess file add the code below.
Replace 123.456.789 with your IP address.

order deny,allow
deny from all
allow from 123.456.789

  • htaccess
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Manage Files in CPanel

In CPanel go to Files -> File Manageror use a FTP client such as FileZilla

Where can I download a free FTP application?

We recommend downloading FileZilla from here.

If you are behind a router enable passive FTP mode.

If you are behind a router enable "passive mode" in the preferences of your FTP program.

My ftp is slow or disconnects while uploading!

Go into your ftp options and see if passive mode is checked. If it is, uncheck it. If it is not...

Password Protect Directories?

You can password protect directory's within cPanel.In cPanel go to Files -> Directory Privacy