Reputation: 2007
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?
Upvotes: 1
Views: 495
Reputation: 14625
the pure ruby solution:
config/routes.rb
match "/blog(/*path)" => redirect{ |params| "http://www.google.com" + (params[:path] ? "/?q=#{params[:path]}" : '/')}
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 ;)
Upvotes: 3