htaccess question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seoguy
    Confirmed User
    • Nov 2004
    • 381

    #1

    htaccess question

    hi,

    can somebody tell me how my htaccess should look like when i want to deny hotlinking from 'bad' sites but allow google and all other search engines with picture search to display my pics?
  • seoguy
    Confirmed User
    • Nov 2004
    • 381

    #2
    ok..

    i found something, would this here work?

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^.*msn\. [NC]
    RewriteCond %{HTTP_REFERER} !^.*yahoo\. [NC]
    RewriteCond %{HTTP_REFERER} !^.*altavista\. [NC]
    RewriteCond %{HTTP_REFERER} !^.*google\. [NC]
    RewriteCond %{HTTP_REFERER} !^.*webcrawler\. [NC]
    RewriteRule ^.+\.(jpg|jpeg|png|gif)$ - [NC,F,L]

    Comment

    • chris01282
      Confirmed User
      • Feb 2005
      • 370

      #3
      Try this http://www.htaccesstools.com

      Hope it helps

      Comment

      • seoguy
        Confirmed User
        • Nov 2004
        • 381

        #4
        this produces this here:

        RewriteEngine on
        RewriteCond %{HTTP_REFERER} !^$
        RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com.*$ [NC]
        RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sub.yourdomain.com.*$ [NC]
        RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sub2.yourdomain.com.*$ [NC]
        RewriteRule ^.+\.(jpg|jpeg|png|gif)$ - [NC,F,L]

        are google and other search engines still able to display my pics then?

        Comment

        Working...