2

http://www.domain.com/old-name-here?manufacturer=445は次のように表示されます。

http://www.domain.com/new-name-here/brand-name

次のhtaccessコードを入力すると:

リダイレクト 301 /old-name-here?manufacturer=445 /new-name-here/brand-name-here

301経由で適切にリダイレクトしますが、クエリ文字列を最後に保持し、最初のフォルダーのみをリダイレクトします...

4

1 に答える 1

0

Redirectディレクティブは QUERY_STRING と一致できません。mod_rewriteルールを使用する必要があります。

DOCUMENT_ROOT/.htaccessファイルでこのルールを使用できます。

RewriteEngine オン

RewriteCond %{QUERY_STRING} (^|&)manufacturer=45(&|$) [NC]
RewriteRule ^old-name-here/?$ /new-name-here/brand-name-here? [NC,L,R=301]

?最後に、既存のクエリ文字列をターゲット URI から取り除きます。

于 2013-11-12T20:33:31.207 に答える