Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   General Business Knowledge (http://www.greenguysboard.com/board/forumdisplay.php?f=10)
-   -   Allowing a domain to hotlink you (http://www.greenguysboard.com/board/showthread.php?t=32285)

RedCherry 2006-06-16 01:55 PM

Allowing a domain to hotlink you
 
Ok, just used the .htaccess in the FAQ section, and stopped some hotlinkers. :D But I have one domain that I use for picposts, so I want to allow some domains to hotlink me. How do I modify that .htacess to allow that?

this is what I have

ErrorDocument 404 http://www.mydomain.com/404.shtml
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*mydomain\.com(:[0-9]+)?(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?1\.2\.3\.4(:[0-9]+)?(/.*)?$
RewriteRule .*\.(asf|mpg|mpeg|wmv|avi|rm|gif|jpeg|jpg|zip)$ - [NC,F,L]


how do I add in domains to that that are ok to hotlink?

cd34 2006-06-16 02:27 PM

RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*otherdomain\.com(:[0-9]+)?(/.*)?$ [NC]

add as many of these as you need above the RewriteRule line with the domains that you want to allow

Jensen 2006-06-16 02:42 PM

when I have questions like that, I just call BrianH at webair... easy :)

RedCherry 2006-06-16 02:56 PM

Thanks sparky! :)

Quote:

Originally Posted by cd34
RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*otherdomain\.com(:[0-9]+)?(/.*)?$ [NC]

add as many of these as you need above the RewriteRule line with the domains that you want to allow


RedCherry 2006-06-18 11:22 AM

Thought I'd pass this along, Mike at Phatservers sent me this. :) The .htaccess generator that is posted in other threads was 404, one of the reasons I started this thread, and this is another good generator.

http://www.htmlbasix.com/disablehotlinking.shtml

juggernaut 2006-06-19 04:58 PM

Yeah I know that place I use has been 404 alot latly. Heres another one, I love the huge amount of options. Most generators do standard, username password, bot blocking etc. This is nice

http://cooletips.de/htaccess/

upallnite 2006-06-21 05:32 AM

Hi RedCherry
Can you show me a movie file that you have protectd with this:

ErrorDocument 404 http://www.mydomain.com/404.shtml
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*mydomain\.com(:[0-9]+)?(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?1\.2\.3\.4(:[0-9]+)?(/.*)?$
RewriteRule .*\.(asf|mpg|mpeg|wmv|avi|rm|gif|jpeg|jpg|zip)$ - [NC,F,L]

If anyone has any type of movie file protected with htaccess I would like to try our test on it.


All times are GMT -4. The time now is 05:13 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc