admin管理员组文章数量:1323353
I just migrated one of my old websites to wordpress but running into issues with the 301's of the old url's
old url /11/companyname
new url /office/companyname/
This is the code i came up with
RewriteEngine On
RewriteRule ^([a-zA-Z-]+)/(.*)?$ /office/$2/ [R=301,L]
It redirects fine when i add the trailing slash i.e. /11/companyname/ but not without.
I just migrated one of my old websites to wordpress but running into issues with the 301's of the old url's
old url /11/companyname
new url /office/companyname/
This is the code i came up with
RewriteEngine On
RewriteRule ^([a-zA-Z-]+)/(.*)?$ /office/$2/ [R=301,L]
It redirects fine when i add the trailing slash i.e. /11/companyname/ but not without.
Share Improve this question asked Feb 28, 2017 at 16:47 thomaswtranthomaswtran 152 bronze badges1 Answer
Reset to default 0Try below Rule,
RewriteRule ^([a-zA-Z-]+)/(.*)/?$ /office/$2/ [R=301,L]
It makes trailing slash optional.
本文标签: htaccess301 Redirect Old URL to New Wordpress Page
版权声明:本文标题:htaccess - 301 Redirect Old URL to New Wordpress Page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742128577a2422056.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论