I am using Windows Server 2008 with IIS7. I need to redirect the users who come to www.mysite.com
to wwww.mysite.com/menu_1/MainScreen.aspx
. Here is the file structure I have for the projects:
-Sites
-Default Web Site
-Menu_1
-MenuService
-VscWebService
I will really appreciate any help on this.
You need to download this from Microsoft: http://www.microsoft.com/en-us/download/details.aspx?id=7435.
The tool is called "Microsoft URL Rewrite Module 2.0 for IIS 7" and is described as follows by Microsoft: "URL Rewrite Module 2.0 provides a rule-based rewriting mechanism for changing requested URL’s before they get processed by web server and for modifying response content before it gets served to HTTP clients"
I think, this could be done without IIS URL Rewrite module. <httpRedirect>
supports wildcards, so you can configure it this way:
<system.webServer>
<httpRedirect enabled="true">
<add wildcard="/" destination="/menu_1/MainScreen.aspx" />
</httpRedirect>
</system.webServer>
Note that you need to have the "HTTP Redirection" feature enabled on IIS - see HTTP Redirects
I could not get this working with the accepted answer, mainly because I did not know where to enter that code. I looked everywhere for some explanation of the URL Rewrite tool that made sense, but could not find any. I ended up using the HTTP Redirect tool in IIS.
Hope this helps.
Source: Stackoverflow.com