I'm going to be deploying an app in the near future on an IIS7 server, and would like to use the per-application URL rewriting settings in web.config
, but this is not an ASP.NET application, so I have no need for anything superfluous.
What is the absolute minimum I need in my web.config in order to run my application and use URL Rewriting?
There is no restriction to use the web. config file in the asp.net web application. You can have 1 Web. config file per folder .
About the URL Rewrite module The Microsoft URL Rewrite Module 2.0 for IIS 7 and above enables IIS administrators to create powerful customized rules to map request URLs to friendly URLs that are easier for users to remember and easier for search engines to find.
The concept of URL rewriting is simple. When a client sends a request to the Web server for a particular URL, the URL rewriting module analyzes the requested URL and changes it to a different URL on the same server.
After lots of googling and stumbling through various articles, I've found this article, which requires installing a URL Rewrite module (not packaged with IIS7). After that it's pretty simple.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule>
<match url="start\.html" />
<action type="Rewrite" url="finish.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
I was pretty surprised that an extra download was required -- I thought this functionality was supposed to be baked in (testing on Win7x64). Oh well, at least it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With