301重定向
问题描述:
实际的URL结构是:301重定向
domain.com/browse-string.html
旧的URL的例子: domain.com/browse-nature - 视频-1-date.html domain.com/browse-science-videos-1-views.html
我已经改变了世界浏览所以新的URL
domain.com/newword-string.html
如何我的301重定向从旧到新?
预先感谢您
答
你可以做一个简单的RewriteRule
并检查字符串的开头是“浏览”。
RewriteEngine On
RewriteRule ^browse(.*)$ /newword$1 [L,R=301]
确保您更改newword
你想要的新词。
你可以在这里进行测试:http://htaccess.mwl.be/
答
放入.htaccess中,它应该工作:
Redirect 301 /oldfile.html /newfile.html
编辑:既然你需要排除/模式的重定向,以下螺纹应解决您:
,不会做它的字符串不是静态这就是为什么我留下了几个网址例子 – auto22
请检查我的答案上面的编辑。 –