.htaccess Image Hot Linking Help

want it to allow only my IP to hot link.

Page 1 of 1

6 Replies - 2247 Views - Last Post: 08 February 2005 - 11:28 AM

#1 soggybox   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 22-October 04

.htaccess Image Hot Linking Help

Posted 11 January 2005 - 05:57 PM

I know the code to put in your .htaccess file to stop people from hot linking is the below:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/stolenimage.gif [R,L]



I was wondering if anyone knew how I would go around so that it would only allow MY IP to hot link images rom my server?

Is This A Good Question/Topic? 0
  • +

Replies To: .htaccess Image Hot Linking Help

#2 soggybox   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 22-October 04

Re: .htaccess Image Hot Linking Help

Posted 11 January 2005 - 07:13 PM

Also is there a way in .htaccess that I could make it so every page and file is replaced with lets say http://www.mydomain....maintenance.php page?

then just delete the code from the .htaccess for all the pages and files to be accessable again? :)
Was This Post Helpful? 0
  • +
  • -

#3 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1960
  • View blog
  • Posts: 20,411
  • Joined: 17-March 01

Re: .htaccess Image Hot Linking Help

Posted 11 January 2005 - 11:02 PM

Yes and Yes, I'll track down the code tomorrow for you. Also going to post a tutorial on how to do the modrewrite for .php -> .htm for SEO
Was This Post Helpful? 0
  • +
  • -

#4 soggybox   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 22-October 04

Re: .htaccess Image Hot Linking Help

Posted 12 January 2005 - 07:45 AM

Thanks :) I'll keep checking later in the day
Was This Post Helpful? 0
  • +
  • -

#5 sakkans   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 29-January 05

Re: .htaccess Image Hot Linking Help

Posted 29 January 2005 - 07:02 AM

hi.. i want to use hotlink protection for my zip files...
i did what you say.
for example, my link is:
http://www.mydomain.com/download.zip

when i write this to a forum (another site) and click... hotlink protection works well!

but.. if i write this to adress bar (about_blank page) and click "go" download is starting...

how can i make this file available for only "clicks" in my site... no outcoming servers! and no "adress bar" entry...

thanks ;)
Was This Post Helpful? 0
  • +
  • -

#6 soggybox   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 42
  • Joined: 22-October 04

Re: .htaccess Image Hot Linking Help

Posted 01 February 2005 - 04:26 PM

:x *poke* Anyone o.o;
Was This Post Helpful? 0
  • +
  • -

#7 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1960
  • View blog
  • Posts: 20,411
  • Joined: 17-March 01

Re: .htaccess Image Hot Linking Help

Posted 08 February 2005 - 11:28 AM

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^YOUR_IP/.*$ [NC]
RewriteRule .*\.(gif|GIF|jpe?g|JPE?G)$ - [F]

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1