クエリ文字列が重要でない場合は、無視できます。
mod_alias 経由:
Redirect 301 /pass-help.php /about/help?
Redirect 301 /contests/contest-a /user/index/contest?
mod_rewrite 経由:
RewriteRule ^/?pass-help\.php$ /about/help? [L,R=301]
RewriteRule ^/?contests/contest-a /user/index/contest? [L,R=301]
mod_alias の場合、最後に stary があることに注意してください?
。これは、クエリ文字列を取り除くために必要です。
クエリ文字列にいくつかのパラメーター名が必要であるが、値は気にしない場合:
mod_rewrite 経由:
RewriteCond %{QUERY_STRING} (^|&)action=
RewriteCond %{QUERY)STRING{ (^|&)email=
RewriteRule ^/?pass-help\.php$ /about/help? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)testa=
RewriteCond %{QUERY_STRING} (^|&)testb=
RewriteRule ^/?contests/contest-a /user/index/contest? [L,R=301]
クエリ文字列に、正確な値を持つパラメーター名が必要な場合:
RewriteCond %{QUERY_STRING} (^|&)action=1
RewriteCond %{QUERY)STRING{ (^|&)email=test@test.com
RewriteRule ^/?pass-help\.php$ /about/help? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)testa=1
RewriteCond %{QUERY_STRING} (^|&)testb=1
RewriteRule ^/?contests/contest-a /user/index/contest? [L,R=301]