たとえば、hxxp://domain.com/store/ にオンライン ストアがあります。
ストア ディレクトリの .htaccess ファイル内には、次のものがあります。
Options +FollowSymlinks
RewriteEngine on
RewriteBase /store/
RewriteCond %{HTTP_HOST} !^www.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/store/$1 [R=301]
RewriteRule ^/?$ directory.php
RewriteRule ^search/?$ search.php
RewriteRule ^category/([a-zA-Z0-9\!\@\#\$\%\^\&\*\(\)\?\_\-\ ]+)/?$ product.php?CategoryID=$1 [QSA]
RewriteRule ^([a-zA-Z0-9\!\@\#\$\%\^\&\*\(\)\?\_\-\ ]+)/?$ product/detail.php?ProductID=$1 [QSA]
それはうまくいきます!
私の問題 (問題) は、/store/ ディレクトリを /shop/ に変更する必要があることです。ただし、適切な 301 リダイレクトを設定して、SE ランキングを失わないようにする必要があります。
この状況で 301 リダイレクトをセットアップする最善の方法は何ですか?
私が見つけた唯一の解決策は、ストア内の各カテゴリ、製品などにリダイレクト 301 をセットアップすることです。たとえば、そのように。
Redirect 301 /store/category/sample-widgets/ hxxp://www.domain.com/shop/category/sample-widgets/
これは機能し、必要なことを行いますが... アドレスバーの URL は次のように表示されます: hxxp://www.domain.com/shop/category/sample-widgets/?CategoryID=sample-widgets
クエリ文字列を削除する理由または方法がわかりません。
助けてください。ありがとう。