gpt4 book ai didi

asp.net - 编辑 web.config 后出现 HTTP 错误 500

转载 作者:行者123 更新时间:2023-12-02 20:26:09 26 4
gpt4 key购买 nike

添加<location>后标记到 web.config (ASP.NET 4) 我得到 HTTP 500 Internal Server Error ,当我删除<location>时它有效。

<?xml version="1.0"?>

<configuration>

<location path="man">
<system.web>
<authorization>
<allow users="man"/>
<deny users="*"/>
</authorization>
</system.web>
</location>

<configSections>
<section name="rewriter"
requirePermission="false"
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>

<system.web>
<compilation debug="true" targetFramework="4.0" />

<authentication mode="Forms">
<forms name=".ASPXAUTH"
loginUrl="Login.aspx"
protection="All"
timeout="30"
path="/"
requireSSL="false"
slidingExpiration="true"
defaultUrl="Login.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="false"/>
</authentication>

<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
</httpModules>

</system.web>

<system.webServer>

<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
</modules>

<validation validateIntegratedModeConfiguration="false" />

</system.webServer>

<rewriter>
<rewrite url="~/man/(.+)" to="~/man/$1" processing="stop" />
<rewrite url="~/man/^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd)(\?.+)?)$" to="~/man/$1" processing="stop" />
<rewrite url="~/files/^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd|\.pdf|\.doc|\.ppt)(\?.+)?)$" to="~/files/$1" processing="stop" />
<rewrite url="~/man/" to="~/man/default.aspx" processing="stop"/>
<rewrite url="~/style/(.+)" to="~/style/$1" processing="stop" />
<rewrite url="~/images/(.+)" to="~/images/$1" processing="stop" />
<rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.axd)(\?.+)?)$" to="$1" processing="stop" />
<rewrite url="~/(.+)" to="~/default.aspx?pn=$1" />
</rewriter>

</configuration>

最佳答案

位置必须位于 configSections 下方

关于asp.net - 编辑 web.config 后出现 HTTP 错误 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8179058/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com