1
getパラメータに基づいてURLを別の場所にリダイレクトしたい場合は、最初のルールがこれを処理するように見えますが、残りは無視されます。以下は.htaccess get paramteresに基づいて別の場所にURLをリダイレクト
http://example.com/def?attachment_id=365 http://example.com/abcdef
http://example.com/def?attachment_id=360 http://example.com/hujkl
私が使っていたコードです。
RewriteCond %{QUERY_STRING} ^attachment_id=365$
RewriteRule ^def/$ http://example.com/abcdef [L,R=301]
RewriteCond %{QUERY_STRING} ^attachment_id=360$
RewriteRule ^def/$ http://example.com/hujkl [L,R=301]