Home .htaccess - hotlink prevention not working for other hosted domains
Reply: 0

.htaccess - hotlink prevention not working for other hosted domains

user973
1#
user973 Published in May 21, 2018, 12:39 pm

This is probably a simple solution, but I have a hosting account and a primary domain associated with it. I also have other domains 'sub-hosted' on the same account. I setup hotlink prevention at the document root. However, it only works for the primary domain. The sub-hosted domains continue to allow hotlinking.

Here is the code I'm using. What modifications might be necessary to prevent hotlinking for the other domains on the same host? Thanks

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?PRIMARY-DOMAIN.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?SUB-HOST1.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?SUB-HOST2.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?SUB-HOST3.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://www.PRIMARY-DOMAIN.com/Images/Hotlink/hotlink.gif [NC,R,L]
RewriteCond %{REQUEST_URI} !^/Images/Hotlink/
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.53976 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO