Jump to content

only allow certain sites to hotlink


Dragen

Recommended Posts

Hi,

I'm trying to sort out an ant-hotlinking thing on my site..

this is my code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?gimppro.co.uk/.*$ [NC]
RewriteRule \.(gif|jpg|js|css)$ - [F]

I literally just copied it from a tutorial, as I have very little htaccess knowledge.

What I'm wanting to do is to allow a set list of sites to hotlink, instead of just mine..

I've tried:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?gimppro.co.uk/.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.co.uk/.*$ [NC]
RewriteRule \.(gif|jpg|js|css)$ - [F]

but it doesn't seem to work..

any ideas??

 

also, am I able to set it so only a specific directory or file on a site can hotlink?

for example.. only:

gimppro.co.uk/downloads/

or

gimppro.co.uk/index.php

 

just some thoughts...

Link to comment
https://forums.phpfreaks.com/topic/49130-only-allow-certain-sites-to-hotlink/
Share on other sites

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.