tags:

views:

35

answers:

2

I have a site that operates in different geographical locations. Some example URLs for my site would be:

http://losangeles.example.com
http://sandiego.example.com/post/blog/travel/
http://sfbay.example.com/blog/read/12/

In these examples, my URL structure is translated to the following:

http://[location code].example.com/[controller]/[event]/[extra parameters]

The script strips off the subdomain and checks it against the db for an acceptable location match, and then the blogs etc. in that location are displayed.

This is all fine and great, but now I am making a Terms of Use page, and I'd like it to have the URL:

http://about.example.com/tou

/* which is translated to: */

http://[controller].example.com/[event]

So essentially, I'd like the subdomain to sometimes be a location code and sometimes a controller.

Any idea how I might do this? Or is this just stupid?

A: 

I'd create a list of controller exceptions that are routed to a default controller. Then let your default controller handle these global pages.

Ben Rowe
im giving this one a whirl at the moment
johnnietheblack
A: 

If there is just one parameter after .com/ treat it differently,

I.e,

http://[location code].example.com/[controller]/[event]/[extra parameters]

Has 2 or more parameters after example.com (controller, event, extra)

and

http://[controller].example.com/[event]

only has 1 (event)

Cetra
thats not bad at all...cept i may wanna pass extra params, you know?
johnnietheblack