2011-05-20 47 views
1

寻找htaccess的高效重定向代码。 大约有200个链接(几乎所有的请求都将通过重定向)htaccess的高效重定向代码

目标:

  1. http://example.com/pages.shtml被重定向到http://example.com/pages

  2. 应该是301重定向记住网页排名保鲜保持

回答

0
RewriteRule ^([^/]+)\.shtml http://example.com/$1 [L,R=301] 
+0

谢谢你Timofey Stolbov! 一个小问题......在这种情况下什么更有效率/更有效。 重写规则^([^ /] +)\。SHTML http://example.com/$1 [L,R = 301] OR 重写规则(([^ /] + /)* [^ /]+)\.(s?html?)$ http://www.example.com/$1 [R = 301,L] – 2011-05-20 12:45:48