Setting up IIS URL rewrite
Saturday 07, February 2015 | Post link
Let's say we have a .NET Web appliation named 'MySite' having an HTML file which requests a .ZIP file using a URL link like "/Content/Download/myfile.zip". On a home Windows 8 PC, the absolute URL for this is http://localhost/Content/Download/myfile.zip. However, the same URL on a Web hosting environment resolves to http://localhost/mysite/Content/Download/myfile.zip.
In order to have the home PC do the same, perform the following steps:
A screenshot of the entire rule is shown:
In order to have the home PC do the same, perform the following steps:
- Install URL rewrite module from http://www.iis.net/downloads/microsoft/url-rewrite
- Create a rule at the ROOT of the Web server (IIS) with the following options:
- Requested rule matches wild-card pattern: "Content/*"
- Ensure Ignore case is checked
- Set ActionType to "Rewrite"
- Set the Rewrite URL to "mysite/Content/{R:1}"
- Select the "Stop processing of subsequent rules"
A screenshot of the entire rule is shown:
Categories:
IIS (1)
Tags:
IIS(1)
Url rewrite(1)
Comments