Ask HN: Way to make blog service at www.mydomain.com/blog vs blog.mydomain.com?
I've been looking for a Rails-powered drop in blog for domains so that I can have www.mydomain.com/blog instead of blog.mydomain.com. As I understand it, Google's PageRank algorithm assigns PageRank scores to each subdomain separately. Thus great blog posts on blog.mydomain.com will improve the PageRank score of blog.mydomain.com separate from the PageRank score of www.mydomain.com. For example, according to http://www.prchecker.info/check_page_rank.php, blog.twilio.com has a PR of 5 while www.twilio.com has a PR of 6. blog.shopify.com has a PR of 6 while www.shopify.com has a PR of 7. My naive guess is that if all the links to blog.shopify.com instead pointed to www.shopify.com/blog/... then the PR for www.shopify.com would be even higher.
Can anyone recommend a rails plugin that will add standard blog functionality (posts, comments, tags, feeds, etc.) into existing rails apps? Or is there some way to 'symlink' (not the right word but a proxy for the idea) the www.mydomain.com/blog/... to use posterous, wordpress, tumblr, etc. underneath?
Lastly, I'd like to avoid rolling my own. I created a simple posts controller in a pinch for a site I started on Thursday (www.formds.com) which was great in allowing links to my main site, but I'd really like to avoid recreating the wheel. It looks bad and is time I'd rather spend elsewhere. I'd _love_ a symlink'd tumblr/posterous/wordpress running under my domain.
Thanks for thoughts,
Robert
7 comments
[ 3.0 ms ] story [ 29.4 ms ] threadb) This is not difficult to accomplish via Nginx (or whatever) using reverse-proxying.
http://www.pastie.org/1071380
http://www.kalzumeus.com/2009/08/22/using-wordpress-and-rail...
I'd always thought that PR applies to your PAGES only. not domains. So, in your example, it's not that blog.twilio.com has a higher PR than www.twilio.com, it's that the blog.twilio.com INDEX page has a higher PR than the www INDEX page.
Thus, your PR isn't really affected by being on a subdomain, as the juice that flows through the system doesn't care about the sub/domain, only about the page and what points to it.
Please correct me as needed.
Basically I have Apache running on port 81 locally, and I setup the WordPress to a "blog" folder underneath the DocumentRoot.
Then within the server { } configure block in nginx, I have
server { # your server settings, like "listen 80;"
}You will have to update the WordPress config to tell that it's installed in a sub folder and not at the root. It took me a while to figure out (all other articles online will tell you to update the wp-config.php file to define the different constants, but it's not the right spot for WordPress 3). You'd have to update the wp_options table as well to fix the path. Here's a screenshot: http://cl.ly/468cab133aca48eea173
Good luck!
(this post should go to StackOverflow, but since I just went through the exact same experience, I thought I'd share it)