View previous topic :: View next topic |
Author |
Message |
boris -
Joined: 01 Jan 2013 Posts: 15
|
Posted: Tue Jun 25, 2019 1:39 pm Post subject: block files of a specific type? |
|
|
How do i block someone from downloading the misc.foo files that are in my www path. i want to block all .foo files from being downloadable by a person putting that filename in the URL request. |
|
Back to top |
|
|
Lawrence -
Joined: 16 Jan 2003 Posts: 207 Location: Brisbane, AU
|
Posted: Tue Jun 25, 2019 1:59 pm Post subject: |
|
|
I'm not sure if this is still the best way, as I haven't updated in a while, but I used a URL Redirect to accomplish this.
This is the Regular Expression:
Code: | ^(/dirs/|/to/|/exclude/)(.+(\.php|\.etc)) |
and it reports an error to the client, a 404.
This will prevent any PHP or ETC files from being delivered from those three directories. |
|
Back to top |
|
|
admin Site Admin
Joined: 03 Mar 2002 Posts: 1298
|
Posted: Thu Jun 27, 2019 2:28 pm Post subject: Re: block files of a specific type? |
|
|
boris,
Lawrence's suggestion is good. There is also another alternative by using IP access rules:
1* Open Abyss Web Server console
2* Press on the "Configure" button in the "Hosts" table
3* Select the icon "IP Address Control".
4* Press "Add" in the displayed table
5* In Virtual Path enter:
*.foo
6* Set Order to "Allow/Deny"
7* Press "OK"
Repeat steps 4-7 for as many extensions or dirs with extensions that you have to limit (as in /dir/*.foo or /dir/path)
8* Press "OK"
9* Now press "Restart"
This will result in anyone trying to access these files to receive error 403. _________________ Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com |
|
Back to top |
|
|
|