【问题标题】:google images hotlink redirect with htaccess谷歌图片热链接重定向与 htaccess
【发布时间】:2015-06-24 11:57:21
【问题描述】:

我想将谷歌图片搜索(热链接图片)直接重定向到我的页面。我目前的解决方案有效,但适用于所有推荐人。我只想让它用于谷歌图片搜索,但我不知道如何。目前我有这个(简化的)htaccess 代码:

RewriteCond %{HTTP_USER_AGENT} !Googlebot-Image [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com [NC]
RewriteCond %{REQUEST_FILENAME} .*jpg$ [NC]
RewriteRule (.*) /hotlink.php?p=$1 [L]

此解决方案有效,但我只想为谷歌制作它。我试过了

 RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?google.com [NC]
 RewriteCond %{REQUEST_FILENAME} .*jpg$ [NC]
 RewriteRule (.*) /hotlink.php?p=$1 [L]

但不起作用。

【问题讨论】:

    标签: .htaccess hotlinking


    【解决方案1】:

    这个呢?

    RewriteCond %{HTTP_REFERER} ^http(s)?://(.*\.)?google\..* [NC] 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-23
      • 1970-01-01
      • 2013-08-24
      • 1970-01-01
      相关资源
      最近更新 更多