Forum Moderators: phranque

Message Too Old, No Replies

After enabling Hot LInk Protection, Server won't allow access

URLs granted access under .htaccess are denied

         

richards1052

4:16 am on Oct 18, 2005 (gmt 0)

10+ Year Member



I've activated Hot Link Protection to prevent other sites fr. direct linking to my images & music files. But there are sites like Google & other image search engines which I want to be able to display my images. I've added them within cPanelx under "urls to allow access." While the URLs did once have such access to my files, they don't any longer & I can't figure out why.

Here is some of the code I have in my root folder's .htaccess file. Am I doing anything wrong?

RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://#*$!.com/~#*$!^http://xxx.com/~xxx/xxx$ [NC]
RewriteCond %{HTTP_REFERER}!^http://xxx.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://xxx.com$ [NC]
RewriteCond %{HTTP_REFERER}!^http://xxx.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://xxx.com$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/xxxx/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/xxx$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx/xxx_xxx/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/xxx_xxx$ [NC]
RewriteCond %{HTTP_REFERER}!^images.xxx.com/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^images.xxx.com$ [NC]
RewriteCond %{HTTP_REFERER}!^http://xxx.org/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://xxx.org/$[NC]
RewriteCond %{HTTP_REFERER}!^http://forums.xxx.com/.*$[NC]
RewriteCond %{HTTP_REFERER}!^http://forums.xxx.com/$[NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/.*$[NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/$[NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/.*$[NC]
RewriteCond %{HTTP_REFERER}!^http://www.xxx.com/$

dcrombie

10:23 am on Oct 18, 2005 (gmt 0)



Well, a few things:

- you can replace !^$ with a single .
- I have no idea what the second rule does or it supposed to do;
- you can always get rid of (delete) .*$ as it doesn't add anything to the regular expression;
- all referers with start with "http" so the lines with ^images are bogus.