Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pointing a Domain to a IIS Site's Sub Folder

Tags:

c#

.net

iis

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

like image 511
regex Avatar asked Apr 10 '09 00:04

regex


People also ask

How do I point a domain to a subfolder?

Click on "Hosting" on the left side of the page under "My Products," then click on "Manage Account" and choose "Domain Management" under "Settings." Click "Add Domain." Enter the new domain name in the field marked "Domain," and enter the sub-folder that will contain the site in the "Folder" field.

How do I point IIS to a folder?

In IIS: Right-click Sites -> Add Web Site and then set the physical path and other details to your new site's file directory.

How do I create a subfolder in IIS?

Answers. Go to the IIS management console (Type inetmgr on run as tab and click enter), create New website, select the web site directory to the folder you have the document index. html. Once you configure IIS, you can access the subfolders within the virtual directory.


2 Answers

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

Using the Microsoft URL Rewrite Module for IIS 7.0

like image 166
Chris Ballance Avatar answered Sep 28 '22 14:09

Chris Ballance


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.

like image 26
SqlRyan Avatar answered Sep 28 '22 14:09

SqlRyan