0

ユーザーがGoogle画像検索から来たときに、「 example.com/photos/logo.jpg」を「example.com/photos/logo 」に変更またはリダイレクトする必要があります。

したがって、私は使用しました:

 RewriteCond %{REQUEST_URI} photos/.*\.(gif|jpg|jpeg|png)$ [NC]
 RewriteCond %{HTTP_REFERER} ^http://www.google.[a-z]{2,4}(.[a-z]{2,4})?/url\?.*$ [NC,OR]
 RewriteCond %{HTTP_REFERER} ^http://www.bing.com/images/search?q=\?.*$ [NC,OR]
 RewriteCond %{HTTP_REFERER} !^http://example.com/.*$ [NC]
 RewriteCond %{HTTP_USER_AGENT} !(.*bot.*|slurp) [NC]
 RewriteRule ^gallery/(.*) /$1 [L,R=301]
4

1 に答える 1

0

試す:

RewriteCond %{HTTP_REFERER} ^http://www.google.[a-z]{2,4}(.[a-z]{2,4})?/url\?.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://www.bing.com/images/search?q=\?.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} !^http://example.com/.*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !(.*bot.*|slurp) [NC]
RewriteRule ^photos/(.*)\.(jpe?g|png|gif)$ /photos/$1 [L,NC,R=301]
于 2013-10-03T04:33:54.887 に答える