In short, I am on IIS, but I was hoping some people with URL Rewriting experience could just lend some advise.
I have a website whose root site is located at c:\web-root\intranet.
Directly below that are a bunch of folders which act as the subdomain to the intranet, ie:
c:\web-root\intranet\apps (this hosts the apps.intranet subdomain content)
c:\web-root\intranet\files (this hosts the files.intranet subdomain content)
There are only 2 subdomains that I want to rewrite to an actual file: ACP and the default (none or ‘www’ specified). So in essence, a request to:
acp.intranet/this/that REWRITES TO /acp/index.cfm?ses=/this/that
www.intranet/this/that REWRITES TO /www/index.cfm?ses=/this/that
intranet/this/that REWRITES TO /www/index.cfm?ses=/this/that (notice that when no subdomain is specified, I want to use www as the default)
Notice that with the above subdomains the “/this/that” is not an actual file/directory location that exists within those folders. Once IIS hands off the rewritten request to ColdFusion (index.cfm) it will use that data to indicate where the user was trying to get to.
But for ANY OTHER SUBDOMAIN, I want it to rewrite as the following
files.intranet/this/that REWRITES TO /files/this/that
apps.intranet/this/that REWRITES TO /apps/this/that
Notice that with these subdomains, the “/this/that” is referencing files and folders to be served to the user. For example:
files.intranet/docs/file.doc WOULD BE REQUESTING /files/docs/file.doc (to be served up)
I hope I have explained this correctly. If someone can suggest some code to help me get there, I’d very much appreciate it. I don’t want to post what I have cause it’d be pointless, as I’m not getting the desired result.