Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 1st, 2008, 03:22 PM
Member
 
Join Date: Aug 2007
Posts: 56
Default Using .htaccess to variably block hotlinking

Hi folks,

I need to combine these two functions and I'm not sure how to go about it. I know how to use .htaccess to prevent anyone from hotlinking the images on my site.

What I basically want to do is to (1) prevent anyone, anywhere from hotlinking my images and (2) prevent anyone from MySpace from hotlinking to my site at all (whether images or otherwise).

Now I currently have my .htaccess like this:

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/theft.jpg [L]
This prevents anyone from hotlinking gif or jpg files on my site, and instead displays the "theft.jpg" image. Works great. But how do I combine this to not allow MySpace to link to *anything* on my site, whether images or otherwise.

Thanks for any assistance you can provide.

Robert
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles