Stop Leechers

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
User avatar
hakkuo23
This is my homepage
This is my homepage
Posts: 88
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Aug 05, 2010 5:04 pm

Stop Leechers

Post by hakkuo23 »

Ok, I want to stop leechers from dowloading files from my website. I want it to restrict people from viewing folders, but it would still allow them to download if they have the specific address to the file. Ex http://yourwebsite.com/files/ would be restricted, but http://yourwebsite.com/files/picture.jpg would not be restricted.
Thanks!
User avatar
Edge100x
Founder
Founder
Posts: 13117
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Stop Leechers

Post by Edge100x »

The easiest way to do this would be to create a blank index.html file in the folder. You could also use the .htaccess file to remove Indexes.
User avatar
hakkuo23
This is my homepage
This is my homepage
Posts: 88
Joined: Thu Aug 05, 2010 5:04 pm

Re: Stop Leechers

Post by hakkuo23 »

Sorry I hit 'New Topic.'
How can I do that without putting an index.html into every folder since I have hundreds?
User avatar
Edge100x
Founder
Founder
Posts: 13117
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Stop Leechers

Post by Edge100x »

Create an .htaccess file in the parent folder of those, containing the following:

Code: Select all

Options -Indexes
User avatar
hakkuo23
This is my homepage
This is my homepage
Posts: 88
Joined: Thu Aug 05, 2010 5:04 pm

Re: Stop Leechers

Post by hakkuo23 »

Thank you it worked perfectly.
I also added a custom 403 error message, so this is what the .htaccess file looks like if anyone else has the same problem as I do:

Code: Select all

Options -Indexes
ErrorDocument 403 http://xxx/index.php
Thank you!
Post Reply