How to Restrict Access to Your Website Using .htaccess File

You may need to restrict access to your website if it is used for admin purposes.

This article shows you how to restrict access to certain IP addresses using a .htaccess file.

1. Log into your portal at https://www.nuttyabouthosting.co.uk/portal.

2. Click on your hosting plan to take you to your hosting control panel.

3. If you have no .htaccess file in the root of your website you need to create one. This is done by either adding a file via file manager or uploading a file using FTP. It is a simple text file you name .htaccess

4. Click on the 'Web Sites' option and select the website you wish to restrict access too.

5. Click on the '.htaccess' tab.

6. Click on the .htaccess file you wish to modify.

7. Edit your .htaccess file and then click the 'Save and continue editing' button.

8. To restrict access to one IP use the following code:

order deny,allow
deny from all
allow from [YOUR IP ADDRESS]
	

9. To restrict access to more than one IP use the following code:

order deny,allow
deny from all
allow from [YOUR HOME IP ADDRESS]
allow from [YOUR OFFICE IP ADDRESS]