私はApacheが初めてです。Apache mod_rewrite を介して、次の URL への永続的な 301 リダイレクトを作成しようとしています。
http://www.mysite.com/products.php?page=TheForm
に
http://www.mysite.com/the-form/
問題は、最初の URL にクエリ文字列があることです。通常は次のコードを使用しましたが、クエリ文字列を RewriteRule に渡すことができないため、この状況にどのように対処できますか。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
RewriteRule ^products.php?page=TheForm$ http://www.mysite.com/the-form [R=301,L]
</IfModule>