I'm using a godaddy coldfusion shared hosting account and I want to provide my users friendlier/direct urls. I've added a wildcard to my domain so all subdomains point to the same root folder.
How do I use just the Application.cfc to route dns wildcards to their appropriate destinations?
index.cfm
in the root folder will just list cities
Going to city.domain.com should bring up domain.com/city/index.cfm
if it exists and domain.com/index.cfm
if it doesn't.
I tried cflocation but I think it went into an infinite loop.
You could always do a server side redirect, and hide it all away from the client.
So regular requests go to index.cfm (www.domain.com)
And then if there is a city (in onRequestStart()):
I put the request scope variable 'forward' in there to stop potential infinite loops, as the Application.cfc is called again.
You can see more details here:
http://www.compoundtheory.com/?action=displayPost&ID=26
http://download.oracle.com/javaee/6/api/javax/servlet/jsp/PageContext.html#forward%28java.lang.String%29