block files of a specific type?

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
boris
-


Joined: 01 Jan 2013
Posts: 15

PostPosted: Tue Jun 25, 2019 1:39 pm    Post subject: block files of a specific type? Reply with quote

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 View user's profile Send private message
Lawrence
-


Joined: 16 Jan 2003
Posts: 207
Location: Brisbane, AU

PostPosted: Tue Jun 25, 2019 1:59 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website ICQ Number
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Thu Jun 27, 2019 2:28 pm    Post subject: Re: block files of a specific type? Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group