1

I use the subdomain to indicate the product eg. nexusphone.site.com . When a user types in that url I render the product/show view of that product. Users can also use domainnames eg www.nexusphone or nexusphone.com to render that product/show view.

www.site.com or site.com should render the home view which explains what my site is about.

I basically want to render the home view when www.site.com or site.com is entered. In all other cases I want to render the product/show view.

In my routes I have

map.club_root '', :controller => 'products', :action => 'show', :conditions => { :subdomain => /.+/ }
map.root :home

This works for the nexusphone.site.com example but not for nexusphone.com. Then it renders the home view.

Someone knows how I can solve this?

Thanks

Tarscher
  • 1,923
  • 1
  • 22
  • 45

2 Answers2

0

maybe the problem is not related with rails...

hope the following link will help

http://www.boutell.com/newfaq/creating/withoutwww.html

cheers

denisjacquemin
  • 7,414
  • 10
  • 55
  • 72
0

With a small code change subdomain-fu can also route based on domain and host. This blog post explains it in more detail.

Tarscher
  • 1,923
  • 1
  • 22
  • 45