同じコンテンツを指す複数のURLをクローラーが来たときだけ一つにまとめる 2007-06-02-1 [Programming] amazon がやってるみたいに「同じコンテンツを指す複数のURLを、クローラーが来たときだけ正規化した一つのURLにリダイレクト」したい。 そこで「.htaccess」に以下のように記述した。 RedirectMatch ^/bot/([0-9A-Z]{10})/ http://example.com/asin/$1/ RewriteEngine On RewriteRule ^asin/([0-9A-Z]{10})/$ go.cgi?asin=$1 [L] RewriteCond %{HTTP_USER_AGENT} bot|ahoo|craw|spid [NC] RewriteRule ^asin/([0-9A-Z]{10})/(.+-22)/$ bot/$
![[を] 同じコンテンツを指す複数のURLをクローラーが来たときだけ一つにまとめる](https://cdn-ak-scissors.b.st-hatena.com/image/square/c4940f7526d0e9c62f4d07918587f6f2effa7093/height=288;version=1;width=512/https%3A%2F%2Fasin.ta2o.net%2Fimg%2F487311182X-l.jpg)