Google images htaccess redirect code not working, help please!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • polle54
    Confirmed User
    • Jul 2004
    • 4626

    #1

    Google images htaccess redirect code not working, help please!

    Hi coders

    I have a slight issues.

    I can't get my Image Redirect Script to function after Google changed the images URL.

    What is wrong with this code:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} ^google\.com/imgres [NC]
    RewriteRule .* http://xxxtremeblog.com/redir/extremesponsor.php [NC,L]

    Trying to make it work on a referrer that looks like this:
    http://www.google.com/imgres?imgurl=...26tbs%3Disch:1
    ICQ# 143561781
  • fris
    Too lazy to set a custom title
    • Aug 2002
    • 55679

    #2
    Code:
    RewriteEngine on 
    RewriteCond %{HTTP_REFERER} ^http://google.com/images [NC] 
    RewriteRule .* http://xxxtremeblog.com/redir/extremesponsor.php [NC,L]
    for google images it should be like this.

    but remember its only for .com, you will need to do some regex to get all google domains incase they come from google.ru etc.
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55679

      #3
      here you go.

      Code:
      RewriteEngine on 
      RewriteCond %{HTTP_REFERER} !^http://.*google\.(com¦(co\.)?[a-z]{2})/(imgres¦search) [NC]
      RewriteRule .* http://xxxtremeblog.com/redir/extremesponsor.php [NC,L]
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      • polle54
        Confirmed User
        • Jul 2004
        • 4626

        #4
        Hi fris, thanks a million, its a step forward, this code, however, redirects everything. both google, google images and direct URL, any suggestions ?
        ICQ# 143561781

        Comment

        • rowan
          Too lazy to set a custom title
          • Mar 2002
          • 17393

          #5
          Try changing .*google to .*images\.google

          Comment

          • fris
            Too lazy to set a custom title
            • Aug 2002
            • 55679

            #6
            Originally posted by polle54
            Hi fris, thanks a million, its a step forward, this code, however, redirects everything. both google, google images and direct URL, any suggestions ?
            sorry remove the search part.

            Code:
            RewriteCond %{HTTP_REFERER} !^http://.*google\.(com¦(co\.)?[a-z]{2})/(imgres¦images) [NC]
            Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

            Comment

            • fris
              Too lazy to set a custom title
              • Aug 2002
              • 55679

              #7
              Originally posted by rowan
              Try changing .*google to .*images\.google
              google doesnt use images.google.com anymore.
              Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

              Comment

              • rowan
                Too lazy to set a custom title
                • Mar 2002
                • 17393

                #8
                Originally posted by fris
                google doesnt use images.google.com anymore.
                Hmmm interesting. I can't find images.google.com, but I can find images.google.* in other country level domains (eg images.google.hk, images.google.ca)

                Comment

                • fris
                  Too lazy to set a custom title
                  • Aug 2002
                  • 55679

                  #9
                  ya but when you goto google images in those countries it doesnt use that url
                  Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                  Comment

                  • polle54
                    Confirmed User
                    • Jul 2004
                    • 4626

                    #10
                    Thanks again, just tried
                    Code:
                    RewriteCond %{HTTP_REFERER} !^[url]http://.*google\.(com¦(co\.)?[/url][a-z]{2})/(imgres¦images) [NC]
                    but that code still redirects everything.
                    Last edited by polle54; 07-14-2010, 10:39 PM.
                    ICQ# 143561781

                    Comment

                    • fris
                      Too lazy to set a custom title
                      • Aug 2002
                      • 55679

                      #11
                      Originally posted by polle54
                      Thanks again, just tried
                      Code:
                      RewriteCond %{HTTP_REFERER} !^[url]http://.*google\.(com¦(co\.)?[/url][a-z]{2})/(imgres¦images) [NC]
                      but that code still redirects everything.
                      my bad that will redirect everything except google images take the ! out of !^
                      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                      Comment

                      • polle54
                        Confirmed User
                        • Jul 2004
                        • 4626

                        #12
                        Originally posted by fris
                        my bad that will redirect everything except google images take the ! out of !^
                        Now it doesn't redirect anything... I wonder if it is something on my machine.. it is a WIN 2k08 R2 server with IIS 7.5..

                        So not a regular setup, but still with a htaccess file.
                        ICQ# 143561781

                        Comment

                        • fris
                          Too lazy to set a custom title
                          • Aug 2002
                          • 55679

                          #13
                          ya never used IIS, would have to look into it more, plus ive never really redirected google image traffic.
                          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                          Comment

                          • rowan
                            Too lazy to set a custom title
                            • Mar 2002
                            • 17393

                            #14
                            Originally posted by fris
                            ya but when you goto google images in those countries it doesnt use that url
                            I found those country level domains in my referer logs, so G is still using them for image searches.

                            Comment

                            • GrouchyAdmin
                              Now choke yourself!
                              • Apr 2006
                              • 12085

                              #15
                              You're probably going to want/need something formatted for IIRF; I have no idea what you're using for a rewrite system, and I don't do IIS either, so -

                              Comment

                              Working...