如何结合现有ASP.NET网站通过IIS重定向Wordpress博客
我开始(通过Web安装平台)在我的Windows(2012)服务器上安装Wordpress博客 在这台服务器上,我已经托管了一个ASP.NETMVC4.5站点 现在,在我继续配置Wordpress站点(打开www.**.com/wp config.php)之前 我似乎在IIS/web.config中创建了一个新的重定向规则 否则,它将与现有ASP.NET站点发生冲突 我已尝试此重定向规则:如何结合现有ASP.NET网站通过IIS重定向Wordpress博客,asp.net,asp.net-mvc,wordpress,iis,Asp.net,Asp.net Mvc,Wordpress,Iis,我开始(通过Web安装平台)在我的Windows(2012)服务器上安装Wordpress博客 在这台服务器上,我已经托管了一个ASP.NETMVC4.5站点 现在,在我继续配置Wordpress站点(打开www.**.com/wp config.php)之前 我似乎在IIS/web.config中创建了一个新的重定向规则 否则,它将与现有ASP.NET站点发生冲突 我已尝试此重定向规则: <rule name="wordpress blog" patternSyntax="Wildcar
<rule name="wordpress blog" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
<add input="{REQUEST_URI}" pattern="^/(blog)" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule>
***.com/blog/wp-config.php我在。****.com/blog/error?aspxerrorpath=/blog/wp-config.php上出现运行时错误
在www.**.com/wp-config.php中添加时(因此在根文件夹中)
**.com/blog/wp-config.php,我得到的错误页面与上面相同
我似乎不明白这条规则应该是什么样子。有人可以帮我吗?根据您的描述,我建议您可以尝试在asp.net应用程序中使用belwo url重写规则
此规则将所有带有blob的请求重定向到index.php
<rule name="wordpress blog" >
<match url="blog/(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="http://{yourdomian}/blog/index.php"/>
</rule>
通过在排除过滤器的global.asax.cs中添加“blog”来解决此问题,如下所示:
i18n.UrlLocalizer.QuickUrlExclutionFilter=new System.Text.RegularExpressions.Regex(@“(?:sitemap.xml.css.jpg.png.svg.woff.woff2.eot.js.html.json)$|(?:blog)” 根据你的描述,我仍然不能清楚地理解你的url重写规则。您的意思是想让www.**.com/**blog/**wp-config.php/访问www.**.com/index.php吗?此外,我建议您可以发布关于500错误的详细错误消息,不,我的意思是将www.*.com/blog从ASP.NET重写逻辑中排除,这样wordpress博客页面就不会与ASP.NET页面冲突。我已经进行了一点:当我转到。**mydomain**.com/en/blog/wp admin/install.php?step=1时,它将显示安装步骤(步骤1)。但是这个页面没有样式,因为CSS没有加载,可能是因为重写配置仍然不正确。当我继续填写字段并单击submit时,页面会将我带到步骤2,但由于重写错误,url会变成。**mydomain.com**/en/install.php?step=2,因此没有/blog/wp admin,我会得到404。
<rule name="wordpress blog" >
<match url="blog/(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="http://{yourdomian}/blog/index.php"/>
</rule>