在 Rails 应用程序中,如何在 appname.com/blog 而不是 blog.appname.com 上发布 Tumblr 或 Wordpress 博客?
我最近阅读了这些关于 SEO 的注释,其中说通过将博客放在子域上,您会失去“Google 果汁”。
我目前在 blog.myapp.com 上建立了一个 tumblr 博客。我需要做什么才能通过 myapp.com/blog 访问同一个博客?
I recently read these notes about SEO which say that you loose "Google juice" by having your blog live on a subdomain.
I've currently got a tumblr blog set up on blog.myapp.com. What do I need to do to have the same blog accessible via myapp.com/blog instead?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
纯 ruby 解决方案:
config/routes.rb
工作原理:
/blog
转到 http://www.google.com/blog/programming/1234-my-article
转到 http://www.google.com/?q=programming/1234-my-article如果您的应用程序之前有一个 apache/nginx 网络服务器,最好在你的 apache/nginx 网络服务器 ;)
the pure ruby solution:
config/routes.rb
How it works:
/blog
goes to http://www.google.com/blog/programming/1234-my-article
goes to http://www.google.com/?q=programming/1234-my-articleIf you have an apache/nginx webserver before your app it's better to add an url rewrite rule in your apache/nginx webserver ;)