Domain and Subdomain Query.

0 views
Skip to first unread message

abhishek shukla

unread,
Nov 6, 2009, 9:42:45 AM11/6/09
to bangal...@googlegroups.com
Hello Friends,

This is the first time I am posting any query to this group. Actually I am stucked at a place where I will be very thankful if someone helps me.

My query is:

We are providing a service where a user can sign up and have there blog and by default we will provide a separate subdomain to ever user  myblog.blogexample.com but if user wants they can replace with there domain

for e.g.
myblog.com which will be actually a pointiing to myblog.blogexample.com

thanks for any help.

--
Thanks & Regards,
Abhishek P Shukla

Amit Mathur

unread,
Nov 6, 2009, 11:12:26 AM11/6/09
to bangal...@googlegroups.com
Setting user specific sub-domains is rather straight forward with Rails (if fact, the very first Rails app, Basecamp has something similar). Refer to this for how Basecamp does it:

http://37signals.com/svn/posts/1512-how-to-do-basecamp-style-subdomains-in-rails

and another more detailed explanation is here:

http://www.robbyonrails.com/articles/2009/01/11/subdomain-accounts-with-ruby-on-rails-explained

Cheers,
Amit.

Subbu

unread,
Nov 7, 2009, 5:10:34 AM11/7/09
to BANGALORE RUG-Ruby Users Group
You should check out subdomain-fu plugin. Here is a link to the
tutorial: http://intridea.com/2008/6/23/subdomainfu-a-new-way-to-tame-the-subdomain

If you have a choice to deviate from sub-domains, then you can give
your your users sub-folders in place of sub-domains. In that case your
users will have blogexample.com/username as their URL. This is very
easy to achieve with simple routing techniques. For example:

map.connect ':username/:year/:month', :controller => 'blogs', :action
=> 'index'

This route will send the user to your blogs controller's index action
and will also supply params[:username], params[:year] and params
[:month] variables to your action.

Some people don't prefer sub-domains because they are tricky with SEO.

-subbu
Reply all
Reply to author
Forward
0 new messages