URL rewrite - web.config error

前端 未结 3 1858
粉色の甜心
粉色の甜心 2021-01-03 21:22

I am getting the following error when i run my .aspx page.

Error Code0x8007000d The configuration section \'rewrite\' cannot be read because it is missing a

相关标签:
3条回答
  • 2021-01-03 22:14

    Make sure your <rewrite> is enclosed in the <system.webServer></system.webServer> section.

    <configuration>
       <system.webServer>
           <rewrite>
              <rules>
                 <rule name="RewriteUserFriendlyURL1" stopProcessing="true">
                 <match url="^([^/]+)/?$" />
                 <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="v.aspx?q={R:1}" />
                 </rule>
              </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    
    0 讨论(0)
  • 2021-01-03 22:17

    The rewrite section in system.webServer is supported in IIS7, but not IIS6. The error is likely caused by deploying this site to a server that's only running IIS6.

    0 讨论(0)
  • 2021-01-03 22:21

    Install the URL Rewrite module http://www.iis.net/download/URLRewrite and that should be sorted. It fixed my problem

    0 讨论(0)
提交回复
热议问题