我已经将Asp.Net Mvc Web应用程序作为应用程序添加到Php站点。(/asp文件夹)
当我调用x.com/asp时,必须执行Asp.Net网络应用程序。但是我得到了这个错误:
HTTP Error 403.18 - Forbidden
The specified request cannot be processed in the application pool that is configured for this resource on the Web server.
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler php-5.6.2
Error Code 0x00000000
Requested URL http://www.x.com:80/index.php
Physical Path D:\WebSites\x.com\index.php
Logon Method Not yet determined
Logon User Not yet determined我在web.config中添加了以下内容:
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="PHP_via_FastCGI" />
<remove name="php-5.6.2" />
<remove name="PHP53_via_FastCGI" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="OzImageHandler" verb="GET" path="/gorsel/*" type="Oz.Services.ImageHandler, Oz.Services" />
<!--<add name="LoggerHandler" verb="*" path="*.logger" type="JSNLog.LoggerHandler, JSNLog" resourceType="Unspecified" />-->
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<modules runAllManagedModulesForAllRequests="true">
<remove name="RoleManager" />
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
</modules>但是php应用程序仍然可以处理/asp请求吗?
解决方案是什么?
IIS7.5 Windows Server 2008 R2
Php应用程序是WordPress
发布于 2015-03-25 18:20:42
要让ASP.NET MVC应用程序在WordPress下工作,可以编辑web.config,然后将其设置为只读,这样之后WordPress就不会应用任何更改。
<rule name="asp.netwebsite" patternSyntax="ECMAScript" stopProcessing="false">
<match url=".*/virtualdirectory.*" />
<action type="None" />
<conditions>
</conditions>
</rule>
<rule name="wordpress" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^store.*" negate="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^virtualdirectory.*" negate="true" />
</conditions>
<action type="Rewrite" url="Index.php" logRewrittenUrl="true" />
</rule>
</rules>我希望这能在未来帮助一些人。此外,使用像@Url.Content()这样的Razor命令来确保正确处理引用也是非常重要的。
https://stackoverflow.com/questions/26962493
复制相似问题