Forum Moderators: phranque
I have added the following code to my .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ [domain.com...] [R=301,L]
When I add this code it messes up my Cpanel hotlink protection that I have enabled. If I fix the Cpanel hotlink protection then the code above gets changed and does not work properly.
Why is this happening and how do I fix this? I am having a huge problem with hotlinking.
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mymaindomain\.(com¦co\.uk)/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?myotherdomain\.(com¦co\.uk)/.*$ [NC]
RewriteRule \.(gif¦jpg¦jpeg¦png)$ - [F,NC]
The above code assumes four domain names; two names and both of those with both .com and .co.uk used. It protects for both www and non-www too.