0

我有的

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。前两个是产品。
  • 我需要排除“关于我们”之类的页面和其他类似的页面。
  • 重定向应该是 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]
4

0 回答 0