首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在IIS Site (WordPress)下运行Asp.Net Mvc应用程序

在IIS Site (WordPress)下运行Asp.Net Mvc应用程序
EN

Stack Overflow用户
提问于 2014-11-17 05:55:08
回答 1查看 595关注 0票数 0

我已经将Asp.Net Mvc Web应用程序作为应用程序添加到Php站点。(/asp文件夹)

当我调用x.com/asp时,必须执行Asp.Net网络应用程序。但是我得到了这个错误:

代码语言:javascript
复制
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中添加了以下内容:

代码语言:javascript
复制
<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

EN

回答 1

Stack Overflow用户

发布于 2015-03-25 18:20:42

要让ASP.NET MVC应用程序在WordPress下工作,可以编辑web.config,然后将其设置为只读,这样之后WordPress就不会应用任何更改。

代码语言:javascript
复制
<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命令来确保正确处理引用也是非常重要的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26962493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档