Only allow specific IPs to view folder and/or files

You’ll need a web.config file in the root of your domain. If you don’t have one, then you can create one through our File Manager or an ftp-program like FileZilla.

If you have a blank web.config file

Add the following code to web.config:


If you already have some code in your web.config file

Add the following code within "configuration" in web.config:

How to set folder or file for restriction

Change the "path" in the code to either a folder or file, where you want to set the restricted access.
It's set to the folder "restricted" in the examples above.

How to set allowed IP

Change the IP ”” to the IP that you want to allow.
You can add more IP-addresses by simply adding more ”add”-lines. Example:

If you would like Surftown to preform this task for you, or if you are in need of any other assistance, please have a look at the paid services we kan offer through our Service Desk Services:
Should you not find what you are looking for then feel free to ask our support

Create A Ticket
Service Desk
Are you facing bigger challenges which requires a bit more know-how and time than you have?

Surftown Service Desk is services where we do the work to you. Our Service desk will get the job done.

Do it for me