• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

PHP Indexes

GameSource

New Member
My host doesnt have directory indexing set up, what is the php code to be able to do this? Makes it easier when adding file info to the file script I use.
 
Thanks, I have tried somethin like that before but didnt know I had to put + before indexes. Thanks alot. Is there a way I can make the files under the folder only downloadable from my site? Like if someone found out the folder and all, they couldnt direct link to my files?
 
Last edited:
Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^[url]http://[/url](www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

replace mydomain.com with your domain
replace the gif & jpg with the extensions you want to protect

you can also replace last line with this:

Code:
RewriteRule \.(gif|jpg)$ [url]http://www.mydomain.com/forbidden.gif[/url] [R,L]

and that will let them know someone is stealing your content.
 
Back
Top