开发者

How to 301 redirect WP pages with a specific word in the URL

I've changed the URL structure of my WordPress pages (not posts) from: mysite.com/pages/something-xxxxx to: my开发者_StackOverflowsite.com/news/something-xxxxxx I'd like to 301 redirect the old structure /pages/ to the new one /news/ via .htaccess.

Thanks in advance


You may use mod_rewrite in your .htaccess:

RewriteEngine on
RewriteRule ^pages/(.*)$ http://yoursite.com/news/$1 [R=301,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜