Topic: thoughts on subdomains vs info in the url

We need to have the location information in the url.  I think there are two options: subdomains and extra info in the url

using subdomains:
  pros
     - looks pretty
  cons
     - would requiring writing to the host file more often
     - not as clean for branding (pana.guatelista.com  vs guatelista.com/pana)
     
  urls would therefore look like:
 
   http://xela.guatelista.com/jobs/show/26   
     
     
using a value in the url:
   pros
     - avoids having to have hundreds of subdomains
     - easier for branding
   cons
     - people who just entered in the main url would need to browse to their particular town         
     
   urls would therefore look like:   
   
      http://guatelista.com/xela/jobs/show/26
     
Any advice, thoughts?

Re: thoughts on subdomains vs info in the url

town.url.com
------------------------------------
Pros
- Looks Pretty - true but the other doesn't look bad either

Cons
- Hosts file - no, use *.domain.com and send everything to it and deal with everything else in the app
- Branding: Why not have both and just redirect domain.com/town to town.domain.com or the other way around

domain.com/town
------------------------------------
Pros
- Avoids lots of subdomains: is this a problem for you?
- Branding: see above

Cons
- Browsing for a town: they need to do that anyway whether you use subdomains or not.

There is no real technical difference. Using the domain.com/town should be better for search engines, so if it was me I'd go with the domain.com/url

Re: thoughts on subdomains vs info in the url

Hey. Thanks for the insight.  Could you clarify this statement or point me in a tutorial that would overview the concepts in a newbie friendly way?   

"use *.domain.com and send everything to it and deal with everything else in the app"

Re: thoughts on subdomains vs info in the url

Well you can setup a DNS entry for *.your_domain.com which will direct everything to a specific IP address. Your rails app can then read the domain and provide the appropriate content.

Re: thoughts on subdomains vs info in the url

Hey. Thanks for the info.  Related question:

I have a listing of user's posts, irrelevant of the subdomain. However, when they click on a link to a given job, I'd like to change the subdomain to be appropriate. For example, if you were looking at your listings from newyork.site.com but click on the listing that is based in detroit.site.com the subdomain should change appropriately.

I could do this in an ugly way using an encoded "href" call, but wondered if there was a more elegant way to do it.  Here's an example of the current way I link to the listings:

<%= link_to job.title, :controller => "job", :action => "show" , :id => job %>
   
Thanks for any insight.