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 a 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-addresses

Change the IP-adressess ”” to the IP-address that you want to allow.
You can add more IP-address 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: https://www.surftown.com/da/service-desk/
Should you not find what you are looking for then feel free to ask our support

Create A Ticket
Service Desk
Står du med en større udfordring, som kræver lidt mere ekspertise og tid end du har til rådighed?

Surftown Service Desk, er en service hvor vi foretager arbejdet for dig. Vores Service desk klarer opgaven for dig.

Gør det for mig