【发布时间】:2016-07-15 22:10:46
【问题描述】:
我在根目录下的 Azure 网站上托管了 ASP.net 应用程序。我为要托管 wordpress 应用程序的博客创建了一个虚拟目录。我部署了 wordpress 应用程序,但在(wordpress 管理面板)登录后单击它会重定向到我的 asp.net 应用程序的错误页面。前端(博客页面)也不可见。
我认为 Web.config 中可能存在一些 URL 重写问题。还需要更改 wordpress 设置中的某些内容。我不确定。
更新: 尝试访问 /blog 时出现以下错误
无法加载文件或程序集“AjaxControlToolKit”或其依赖项之一。系统找不到指定的文件。
wwwroot 文件夹中的 Web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxQueryString="32768" />
</requestFiltering>
</security>
</system.webServer>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000" />
</webServices>
</scripting>
</system.web.extensions>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
<system.web>
<!-- Remove httpcookies in production -->
<httpCookies httpOnlyCookies="true" requireSSL="false" />
<customErrors mode="Off" />
<authentication mode="None" />
<compilation targetFramework="4.5">
<assemblies>
<add assembly="AjaxControlToolKit" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />
<pages>
<controls>
<add assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
</controls>
</pages>
</system.web>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="home.htm" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
【问题讨论】:
-
我用
ASP.NET Starter Web App模板创建了一个Azure Web App,并在根目录下放了一个wordpress文件夹,安装wordpress后,它就在我这边工作了。您能否提供根目录中的web.config内容? wordpress 数据库是干净的还是有一些旧的 wordpress 配置,例如Permalink Settings? -
我在根目录下添加了web.config内容。 Wordpress 干净,数据库新鲜。
-
您收到错误是因为 AjaxControlToolkit 在“父”web.config 中 - 在 Wordpress 文件夹上方的文件夹中。此外,此配置已删除所有默认文档,然后添加“home.htm”作为唯一的默认文档。您至少需要 index.php 作为运行 Wordpress 的默认文档。
-
我知道我应该在默认文档列表中添加index.php但是如何修复Ajaxcontrol工具包错误?
标签: php asp.net wordpress azure