phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Stop Hotlinking

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
opitanga



Joined: 25 Jul 2008
Posts: 8

Stop HotlinkingPosted: Thu Aug 21, 2008 3:50 am    Post subject: Stop Hotlinking

Hello there,

I am trying to stop hotlinking with this:
Code:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?YOURSITE\.COM/.*$ [NC]
RewriteRule .*\.(gif|jpg)$ http://www.YOURSITE.COM/images/stolen.gif [R,NC,L]
</ifModule>


The only problem is that http has the www and https has NO www
So the stolen.gif appears instead of the regular images in the my own https area.
Any help to rewrite the above to avoid this?

Thanks
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

Stop HotlinkingPosted: Sat Aug 23, 2008 8:40 am    Post subject: Re: Stop Hotlinking

Try :
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?YOURSITE\.COM/.*$ [NC]
RewriteRule .*\.(gif|jpg)$ http://www.YOURSITE.COM/images/stolen.gif [R,NC,L]
</ifModule>


++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: