简体   繁体   English

如何将我的Wordpress网站的博客链接重定向到新的子域?

[英]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的管理员设置并更改

  • WordPress Address (URL) WordPress地址(URL)
  • Site Address (URL) by blog.cooksmarts.com 网站地址(URL)by blog.cooksmarts.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails路由重定向到子域上的博客 - Rails Routes Redirect To Blog On Subdomain 如何将Rails页面设置为另一个站点的子域? - How do I set up a Rails page as a subdomain of another site? 我如何在Rails中使用子域将用户重定向到其域 - how do i use subdomain in rails to redirect users to thier domains 如果子域不存在,如何重定向请求? - How do I redirect request if a subdomain does not exist? 使用Bloggy gem在Rails站点中的Jekyll博客:在每个构建中,如何在博客中使用Rails CSS? - Jekyll blog in Rails site using Bloggy gem: how do I use the Rails css for the blog, on each build? 如何在Mian域上托管Wordpress网站,以及如何在Rails网站上托管子域 - How to host wordpress site on mian domain and rails site a subdomain 如何将子域重定向到 rails 路由中的新 url - How to redirect subdomain to a new url in rails routes 如何在控制器中重定向到我的站点的根目录 - How Can I Redirect to My Site's Root In a Controller 如何配置nginx在域中使用Rails应用程序,在/ blog /中使用WordPress? - How do I configure nginx to have a Rails app at a domain and WordPress at /blog/? 将Wordpress博客路由到Rails子文件夹 - 博客链接未更改 - Route Wordpress Blog to Rails Subfolder - Blog Links Not Changed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM