Wednesday, April 20, 2011

Pointing a Domain to a IIS Site's Sub Folder

Hey All,

Sorry for the possibly misleading title of this post. Couln't really think of anything better at the moment.

Anyway, I have a site set up that allows users to search our customer database. I have a separate section of this site listed under a "reports" directory, which is used to generate billing reports, subscriber counts, etc. Apparently our users are confused about having to type in the reports folder on the url: http://maindomain/reports/.

I'm wondering if there is a way to create a new domain that points to that specific folder. In other words, users go to http://reportsdomain/ which would be an alias for http://maindomain/reports/. The solutions that I've considered are as follows:

  1. Create a new site in IIS that points to the reports folder (which is a sub folder in the other site... seems like a bad practice since then two seperate IIS sites will be doing caching for that site, maintaining session/application state, etc).
  2. Build a IIS module to do URL rewriting

Of those two options, I'd probably go with 2 before 1. Any other ways to do this that I'm not thinking of?

Thanks in advance for your help.

Respectfully,

Chris

From stackoverflow
    • Option 2 would be more ideal than the extra overhead of having two sites.

    Using the Microsoft URL Rewrite Module for IIS 7.0

  • It would also be possible to handle this at the DNS level.

  • If you're okay with the user typing in the main URL and then being forwarded to the new URL, you just set up the http://maindomain site in IIS and then on the "Home Directory" page, set it to forward to http://maindomain/reports/.

    While this isn't as clean as the URL re-writing option, it's painless to enable, and it seems like this might be the option you're looking for.

0 comments:

Post a Comment