繁体   English   中英

编辑web.config后,ASP重定向错误

[英]ASP Wrong redirection after edit web.config

我尝试编辑旧ASP网站首页的URL。 该文件为Default.aspx ,当前URL为/homepage 我这样编辑web.config以使用新的(测试)URL /homepage123

<rule name="RedirectHomepage" stopProcessing="true">
            <match url="^Default\.aspx$" />
            <conditions>
              <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
            </conditions>
            <action type="Redirect" url="homepage123" appendQueryString="false" />
          </rule>
          <rule name="RewriteHomepage" stopProcessing="true">
            <match url="homepage123" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Rewrite" url="Default.aspx" />
          </rule>

我的问题是/homepage123在Visual Studio中启动应用程序时不起作用。 当我尝试访问Default.aspx ,我总是重定向到/homepage

如果使用IIS 7或IIS 7.5,则可以在webconfig文件中设置defaultDocument

<system.webServer>
  <defaultDocument>
    <files>
      <clear />
      <add value="homepage123.aspx" />
    </files>
  </defaultDocument>
</system.webServer>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM