htaccess - 将根页面重定向到文件夹

时间:2013-06-18 09:56:06

标签: .htaccess redirect

我有什么

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多种产品。
  • 需要将产品重定向到前缀为名为“product”的“文件夹”的同一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]

0 个答案:

没有答案
相关问题