Lunarpages Web Hosting Forum

Author Topic: How To: Correct the issue with hotlink protection  (Read 15314 times)

leighsww

  • Guest
How To: Correct the issue with hotlink protection
« Reply #15 on: January 22, 2004, 06:02:12 PM »
I found that out, too, EJ.  So now, I don't use the Hotlinks Protection via cPanel to update, I go straight into the .htaccess file and add things there.

Offline Hush

  • Über Jedi
  • *****
  • Posts: 2830
How To: Correct the issue with hotlink protection
« Reply #16 on: January 22, 2004, 06:06:22 PM »
Hello,

Sorry took a while to come back to this.  There are glitches every now and again, and if you are comforable just starting straight in .htaccess, this will always be better.  The lines of code can just be entered.

There is also a really handy tool available for free use at:HTML Basix please excuse the popup ads  :thumb:
<- From the ashes will rise a phoenix ->

Lunarpages Web Hosting || Lunarpages Forums || Lunarpages Affiliate Program

Offline EJ

  • Galactic Royalty
  • *****
  • Posts: 247
How To: Correct the issue with hotlink protection
« Reply #17 on: January 23, 2004, 11:03:07 AM »
Quote from: Hush
Hello,

Sorry took a while to come back to this.  There are glitches every now and again, and if you are comforable just starting straight in .htaccess, this will always be better.  The lines of code can just be entered.

There is also a really handy tool available for free use at:HTML Basix please excuse the popup ads  :thumb:


No problem Hush,

Do I need to disable hotlink protection, first? And I'll check out that link, Thanks


edit:everything seems to be working, so I'll leave it be
I love the new LPF theme

Offline datahomi

  • Trekkie
  • **
  • Posts: 18
    • http://www.datahomi.com
How To: Correct the issue with hotlink protection
« Reply #18 on: February 01, 2004, 05:45:10 PM »
tks for the tip!

im tryin to do it now!

Offline dfaonxa

  • Intergalactic Cowboy
  • *****
  • Posts: 68
How To: Correct the issue with hotlink protection
« Reply #19 on: April 08, 2004, 07:01:44 AM »
Okay, I'm dredging up an old subject here, but... I've been having this precise problem (that when I think about it occurred when I altered my .htaccess file to deny hotlinking), but when I made the changes suggested (I simply copied/pasted the text and changed it to my domain name), my page returns a 500 error.  Any suggestions?

leighsww

  • Guest
How To: Correct the issue with hotlink protection
« Reply #20 on: April 08, 2004, 10:47:40 AM »
Did you edit the htaccess file in cPanel, or in Notepad the uploaded via FTP client?  If you did the latter, did you upload in ASCII mode?  If you didn't, then it probably uploaded in binary and that may be the problem.

Try again.

Offline dfaonxa

  • Intergalactic Cowboy
  • *****
  • Posts: 68
How To: Correct the issue with hotlink protection
« Reply #21 on: April 08, 2004, 01:09:20 PM »
I did it over FTP, so I tried uploading in ASCII and it still gives me the same problem.  I haven't been able to get into cPanel lately (404 errors) so I haven't been able to try that yet.

leighsww

  • Guest
How To: Correct the issue with hotlink protection
« Reply #22 on: April 08, 2004, 01:17:21 PM »
Post what your htaccess file looks like.

Offline dfaonxa

  • Intergalactic Cowboy
  • *****
  • Posts: 68
How To: Correct the issue with hotlink protection
« Reply #23 on: April 08, 2004, 05:01:47 PM »
AddHandler server-parsed .htm

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http:// ( www \ . )? passionbreedsfollowers.com ( / )? .*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ - [F,NC]


(the first line to enable hidden SSI)

leighsww

  • Guest
How To: Correct the issue with hotlink protection
« Reply #24 on: April 08, 2004, 05:23:38 PM »
You have spaces where there shouldn't be.  This line should look like this:

Code: [Select]

RewriteCond %{HTTP_REFERER} !^http://(www\.)?passionbreedsfollowers.com(/)?.*$ [NC]


Remove the space in front of "passion" and after ".com" (you can just copy the above line and paste over the original line in your .htaccess), then it should work.

I don't know anything about the SSI line, so if the above still doesn't work, then it could be that first SSI line you have that's causing the problem.

Again, I don't know much about the SSI line, but if it's an Apache Handler, aren't you supposed to add it in the Apache Handler section of cPanel?

Someone may be able to verify this, as I don't know much about Apache Handlers.

Offline dfaonxa

  • Intergalactic Cowboy
  • *****
  • Posts: 68
How To: Correct the issue with hotlink protection
« Reply #25 on: April 08, 2004, 05:37:58 PM »
AHA, it finally works!  Thanks so much for your help!   :yey:

Offline Amy

  • Administrator
  • Berserker Poster
  • *****
  • Posts: 10081
How To: Correct the issue with hotlink protection
« Reply #26 on: April 17, 2004, 02:16:52 PM »
Just tried this, and the original post inserts a space with the colour tag

Quote from: leighsww
You have spaces inserted where there shouldn't be.  It should look like:

Code: [Select]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain1.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain2.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sub.domain1.com(/)?.*$ [NC]
RewriteRule .*\.(gif|bmp|jpg|png|zip|rar|exe)$ - [F,NC]


You probably copied and pasted Hush's code, but he had put in the color tags to make some parts RED which inserts a space.


Thanks for the help

leighsww

  • Guest
How To: Correct the issue with hotlink protection
« Reply #27 on: April 17, 2004, 02:44:34 PM »
Good that you posted that in this thread, Visitor, because this will be a problem for a lot of others (as it was for you and dfaonxa), when they copy and paste the code with the RED tags in it.

Hopefully, people will read through this entire thread, so that they remove the spaces.

Hush - maybe you should revise your original post to have a "Copy and paste this version" (for example) so that they don't copy the one with the RED tags. The one with the RED tags is still good to show where the changes occur, but the "copy & paste" version will be what they can actually use for the htaccess file.

Offline Amy

  • Administrator
  • Berserker Poster
  • *****
  • Posts: 10081
How To: Correct the issue with hotlink protection
« Reply #28 on: April 27, 2004, 01:14:04 PM »
In the end I found by just adding...
RewriteCond %{HTTP_REFERER} !^$

fixed the problem anyway :)

Offline satirista

  • Spacescooter Operator
  • *****
  • Posts: 31
    • http://www.elizabethhanes.com
Still valid?
« Reply #29 on: May 23, 2004, 06:10:23 PM »
Hi!

Is this still an issue and a valid fix?

If so, I have a question...

In my .htaccess file, my site name shows up in various permutations, including:

!^http://elizabethhanes.com/.*$
!^http://elizabethhanes.com$
!^http://www.elizabethhanes.com$
!^http://www.elizabethhanes.com/.*$

Do I need to modify the ones without the "www"? If so, how?

Do I need to modify the ones without the slash at the end? If so, how?

Thank you very much for this useful feature and for your wonderful explanation of how to make it work properly!

Elizabeth