Reputation: 1052
I have an asp.net application on sub domain sub.domain.com I want to access this application by typing www.domain.com/sub is it possible with IIS7?
Upvotes: 1
Views: 1360
Reputation: 1514
Assuming you're happy to manually configure the application at each subdomain:
Alternatively you could set up a redirect by creating a new Virtual Directory in your www.domain.com site, then dropping in a default.html file that does a http redirect.
A posher (and more transparent to the user) redirect could be done like so:
run the following command:
%windir%\system32\inetsrv\appcmd set config "nameofsite/virtualdirectoryname" -section:system.webServer/httpRedirect -enabled:true -destination:destinationofredirect -commitpath:apphost
I lifted that from: http://www.andrewwestgarth.co.uk/Blog/post/2008/07/31/Creating-Http-Redirects-in-IIS7-on-Virtual-Directories-like-IIS6.aspx
Upvotes: 3