What I have

http://www.my-domain.com/my-product1/
http://www.my-domain.com/another-product/
http://www.my-domain.com/about-us/

What I want

http://www.my-domain.com/product/my-product1/
http://www.my-domain.com/product/another-product/
http://www.my-domain.com/about-us/

The problems

  • 我有大约100种产品 .

  • 需要将产品重定向到前缀为"folder"的同一URL,名为"product" . 首先是产品 .

  • 我需要排除像"about-us"这样的页面和其他类似的页面 .

  • 重定向应为301 .

Question

怎么做?我认为,列出重定向每个产品的时间太长了 .

What I have found out so far

这可能是一个好的开始 .

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]