htaccess help please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • X37375787
    • Aug 2026

    #1

    htaccess help please

    how can I achieve that a hotlinked pic will be replaced by a predetermined other one?

    This is what I got, it doesn't seem to work though...


    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://blah1.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.blah1.com.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://blah1.com:80.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.blah1.com:80.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://xxx.xxx.xxx.xxx.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://xxx.xxx.xxx.xxx:80.*$ [NC]
    RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.blah2.com/hotlink.gif


    Thanks....
  • X37375787

    #2
    blah2.com is not affected by this htaccess...

    Comment

    • The Truth Hurts
      Zph7YXfjMhg
      • Nov 2002
      • 15762

      #3
      good question, i have the same basic layout, and instead of the alternate pic, i just get the red x.

      Comment

      • X37375787

        #4
        the problem is that I can stil hotlink like a champ...

        wtf?

        Comment

        • The Truth Hurts
          Zph7YXfjMhg
          • Nov 2002
          • 15762

          #5
          RewriteEngine on
          RewriteCond %{HTTP_REFERER} !^$
          RewriteCond %{HTTP_REFERER} !^http://domain.net$ [NC]
          RewriteCond %{HTTP_REFERER} !^http://www.domain.net$ [NC]
          RewriteCond %{HTTP_REFERER} !^http://domain.net/.*$ [NC]
          RewriteCond %{HTTP_REFERER} !^http://www.domain.net/.*$ [NC]
          RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.domain.net/hotlink.gif [R,L]


          one i'm using...
          protection works, replacement image doesn't.

          Comment

          • X37375787

            #6
            I noticed I was missing the [R,L] ...


            Your problem is that you probably have the hotlink image in the protected folder itself. Move it to another unprotected domain and change the htaccess accordingly.

            Comment

            • The Truth Hurts
              Zph7YXfjMhg
              • Nov 2002
              • 15762

              #7
              cool... i'll give it a shot.

              Comment

              • The Truth Hurts
                Zph7YXfjMhg
                • Nov 2002
                • 15762

                #8
                good call, works now ; ))

                thanks.

                Comment

                • X37375787

                  #9
                  Originally posted by The Truth Hurts
                  good call, works now ; ))

                  thanks.

                  np

                  Comment

                  Working...