IIS7 Url Rewrite Module gives an error when trying to configure rewrite rules
5,799
IIS6 and IIS7 use distinct parts of the web.config
file in order to specify site configuration.
For example, IIS6 uses the system.web
section, whereas IIS7 uses the system.webServer
section. But, it's not so simple as changing that one element because the underlying children are also different.
Some key changes:
-
<httpModules>
and<httpHandlers>
have been renamed to<modules>
and<handlers>
, respectively. - Each handler in IIS7 requires a name attribute. If you don't specify it, you'll get an error message.
- The handlers node has an optional, but good-to-define
accessPolicy
attribute. This value depends on your handlers, so use the ones that are right for you.
These suggestions and more information can be found in this posting: Use a Single Web.Config for IIS6 and IIS7
Related videos on Youtube
Author by
Admin
Updated on September 17, 2022Comments
-
Admin over 1 year
When clicking on the Url Rewrite feature in the IIS7 Manager I get an error:
There was an error while performing this operation. Details: Filename: \\?\C:\Domains\...<blah_blah>...\web.config Error: The configuration section 'system.webServer/rewrite/rules' cannot be read because it is missing a section declaration
I just moved from a IIS6 setup to a IIS7 server and my web.config file does not have a rewrite section under system.webServer