Forum Moderators: phranque
I want to restrict access to my downloads, so that you can only download them from either of my sites: www.site1.com and www.site2.co.uk.
I know that .htaccess can do this but I haven't got a clue as to what the code should be.
Any help would be very much appreciated!
Casper
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}! ^http://www.mydomain.com/.*$ [NC]
RewriteRule .*\.(.*doc¦pdf¦txt¦xls¦mp3¦otherextension)$ [mydomain.com...] [R,NC]
caveat: forum software breaks the vertical pipe and loses some spaces, so you want to be sure to not just copy and paste the above.