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
Share on other sites

  • 4 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.