开发者

How to redirect a page in a site to another page in wordpress

I am trying to get a url to be redirected to another site. For eg. www.abc.com/开发者_JS百科joe needs to be redirected to www.xyz.com/joe

where www.abc.com is a wordpress site.

thanks

Prady


You can do this at the web server level; WordPress isn't involved. Add to your .htaccess:

RewriteRule ^/?joe$ http://www.xyz.com/joe [R=301,L]

After the "RewriteEngine On" line that's already there because of WordPress.


You might find this answer I wrote over at SO's sister site WordPress Answers to be helpful. In short you can use PHP and a WordPress hook to do the redirection which keeps you from having to mess with .htaccess and gives you a lot more control over what happens as well:

  • Creating 301 Redirects for Post, Page, Category and Image URLs?

Hope this helps.

-Mike

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜