繁体   English   中英

重定向到Home.aspx页

[英]Redirect to Home.aspx page

我试图在首次加载项目时重定向到Home.aspx ,但是无论我做过什么还是在web.config文件中进行更改,仍然会重定向到Login.aspx

web.config

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

<location path="Login.aspx">
<system.web>
  <authorization>
    <allow users="?" />
  </authorization>
</system.web>
</location>

<location path="Home.aspx">
<system.web>
  <authorization>
    <allow users="?" />
  </authorization>
</system.web>
</location>

<system.webServer>
<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>
</system.webServer>

请参阅path="*." 如果我将其设置为path="Home.aspx" ,它将重定向到Home.aspx,但整个项目中的数据库将被隐藏。 问题是什么使网站始终重定向到Login.aspx ?什么是在首次启动时强制网站重定向到Home.aspx的最佳方法?

谢谢

尝试在Web.config中进行表单身份验证

</configuration>
   <system.web>
        <!--Session state Time Out-->
        <sessionState timeout="60" /> 
        <!--My authontication module-->
        <authentication mode="Forms">
          <forms name="WSMSCRM.ASPXAUTH" loginUrl="~/Login/Login.aspx" protection="All" path="/" timeout="60"/>
        </authentication>
        <authorization>
          <deny users="?" />
        </authorization>
        <!--location add-->
        <!--End of Authontication-->
    </system.web>

<!--Rest is ommited-->
  <location path="~/Login/Login.aspx">
    <system.web>

      <authorization>
        <allow users="*"/>

      </authorization>
    </system.web>

  </location>
</configuration>

兄弟尝试在webconfig文件中执行此操作。...我的问题得到了解决...

<configuration>
<system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="Home.aspx"/>
</system.web>
</configuration>

暂无
暂无

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

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