[英]How do I redirect the blog links of my Wordpress site to a new subdomain?
My current site (www.cooksmarts.com) is on Wordpress. 我当前的网站(www.cooksmarts.com)在Wordpress上。 We are launching a rails app (which will be hosted by a service like Heroku / Engine Yard) and are considering housing the app in our root domain.
我们正在启动一个Rails应用程序(将由Heroku / Engine Yard之类的服务托管),并正在考虑将该应用程序包含在我们的根域中。 If so, we'd move my blog to to a subdomain, like blog.cooksmarts.com.
如果是这样,我们会将我的博客移到一个子域,例如blog.cooksmarts.com。 Right now all the blog entries are updated in the subfolder www.cooksmarts.com/cs-blog.
现在,所有博客条目都在子文件夹www.cooksmarts.com/cs-blog中更新。 How do I redirect only calls for that subfolder to the new subdomain?
如何将仅对该子文件夹的调用重定向到新的子域? For example if any existing link pointed to http://www.cooksmarts.com/cs-blog/2013/03/Chicken-Recipe , it would automatically re-direct to http://blog.cooksmarts.com/2013/03/Chicken-Recipe
例如,如果任何现有链接指向http://www.cooksmarts.com/cs-blog/2013/03/Chicken-Recipe ,它将自动重定向到http://blog.cooksmarts.com/2013/03 /鸡肉食谱
create subdomain in cs-blog folder 在cs-blog文件夹中创建子域
simply add rewite rule in your htaccess file like this 只需像这样在您的htaccess文件中添加ruite规则
RewriteCond %{HTTP_HOST} ^www.cooksmarts.com/cs-blog/ [OR]
RewriteCond %{HTTP_HOST} ^cooksmarts.com/cs-blog/
RewriteRule (.*) http://blog.cooksmarts.com/$1 [R=301,L]
then goto wordpress admin setting and change 然后转到WordPress的管理员设置并更改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.