Apache .htaccess重定向以将旧站点结构映射到新站点结构

Apache .htaccess重定向以将旧站点结构映射到新站点结构,apache,.htaccess,redirect,Apache,.htaccess,Redirect,我用新的CMS更新了我的网站 旧站点结构: www.domain.com/arc/web/index.shtml www.domain.com/arc/web/category/page.shtml 新网站结构: www.domain.com www.domain.com/category/page 我需要将旧网站结构的网页映射到新网站结构: www.domain.com/arc/web/index.shtml至www.domain.com www.domain.com/arc/web/cate

我用新的CMS更新了我的网站

旧站点结构: www.domain.com/arc/web/index.shtml www.domain.com/arc/web/category/page.shtml

新网站结构:
www.domain.com
www.domain.com/category/page

我需要将旧网站结构的网页映射到新网站结构:
www.domain.com/arc/web/index.shtml至www.domain.com
www.domain.com/arc/web/category/page.shtml至www.domain.com/category/page

我尝试了以下重定向,但未正常工作:

重定向301/arc/web/aboutwecaneip/
重定向301/arc/web/aboutwecaneip/GuidingPrinciples.shtml

处理这个问题的最佳方法是什么


提前感谢所有的帮助和建议

这是mod rewrite的一个很好的用法

下面是一个针对特定用例的配置,您希望将其放入apache配置中:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule ^/arc/web/index.shtml$ /index.html [L]
   RewriteRule ^/arc/web/(.*)/(.*).shtml$ /$1/$2 [L]
</IfModule>

重新启动发动机
重写规则^/arc/web/index.shtml$/index.html[L]
重写规则^/arc/web/(.*)/(.*)。shtml$/$1/$2[L]

谢谢Scott,我会试试看!:)