私が持っているもの
http://www.my-domain.com/my-product1/
http://www.my-domain.com/another-product/
http://www.my-domain.com/about-us/
私が欲しいもの
http://www.my-domain.com/product/my-product1/
http://www.my-domain.com/product/another-product/
http://www.my-domain.com/about-us/
問題点
- 私は約100以上の製品を持っています。
- 製品は、「製品」と呼ばれる「フォルダ」が前に付いた同じ URL にリダイレクトする必要があります。最初の 2 つは製品です。
- 「about-us」などのページを除外する必要があります。
- リダイレクトは 301 にする必要があります。
質問
それはどのように行われますか?すべての製品を手動でリダイレクトする方法をリストするには長すぎると思います。
これまでにわかったこと
これは良いスタートかもしれません。
http://www.brightcherry.co.uk/scribbles/htaccess-301-redirect-an-entire-directory-folder/
RewriteEngine on
RewriteBase /
RewriteRule ^old_dir/(.*) http://www.example.com/new_dir/ [R=301,L]