Forum Moderators: phranque

Message Too Old, No Replies

hotlink protection and mod rewrite

why does it break htaccess?

         

soapystar

7:14 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



here's a strange one, at least to me it is anyway. I had my host enable hotlink protection to stop linking to my images which are copyrighted. However after it was setup my users were having problems with the site so i logged onto cpanel to disable it. After this i found my rule for direcing non-www calls to the www version was brocken.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com
RewriteRule (.*) [mydomain.com...] [R=301,L]

however all other rules seem to be intact. So i uploaded the htaccess file again and got it working again. But this enabled hotlink protection again. So i disabled it via cpanel only to find this has broken the rewrite rule. And so the merry go round continues, i cant get the rewrite rule to work without re-enabling hotlink protection.

Any thoughts?
Cheers!

bcolflesh

7:16 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Forget about the Cpanel "wizard" and manually configure your .htaccess file.

jdMorgan

7:55 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lots of anti-hotlinking examples here [google.com]...

Jim

soapystar

8:53 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks appreciate the help. I have already decided to not enable the hotlink protection but i cant work out how to repair my current htaccess rules without re-enabling it with each new upload of the htaccess file. I dont even understand why this happening. I want to repair the 301 rewrite without re-enabling the protection in cpanel.

bcolflesh

8:59 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Post the contents of the .htaccess file here (with the domains changed).

soapystar

9:14 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok whats happening is....everytime i disable protection from cpanel its wiping this rule:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com
RewriteRule (.*) [mydomain.com...] [R=301,L]

if i reload the file hotlink protection is renabled...if i check the file after cpanel has renabled itself there are no added lines..just the removal of the above rule...

jdMorgan

11:32 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like a question for your hosting service, unless cPanel has an "off" button. :(

Jim

soapystar

10:00 pm on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cpanel bug

plus hotlink seems more trouble than its worth. Concluded it easier just to move the image folders around than anything else. That way any links direct to images will be constantly broken while the urls remain intact.