繁体   English   中英

IIS Url Rewrite for Wordpress子文件夹站点

[英]IIS Url Rewrite for Wordpress subfolder site

我在根文件夹中运行两个单独的Wordpress实例,在子文件夹中运行一个。 这些Wordpress实例在IIS上运行。

我得到了在根wordpress实例上工作的固定链接。 但这不适用于子文件夹中的wordpress。

我正在尝试使用此规则集在子文件夹中使用单独的web.config。 但是它将无法正常工作。 有什么事吗

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed" />
    <rewrite>
      <rules>
        <rule name="90-Numre" stopProcessing="true">
        <match url=".*" />
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
        <action type="Rewrite" url="^90-numre/index.php/{R:0}" /></rule>
            <rule name="wordpress1" patternSyntax="Wildcard">
                <match url="*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
        <action type="Rewrite" url="^90-numre\index.php" />
        </rule>     
        </rules>
    </rewrite>
    <defaultDocument>
      <files>
        <clear />

        <add value="index.php" />
      </files>
    </defaultDocument>
  </system.webServer>
    <system.web>
        <customErrors defaultRedirect="" mode="RemoteOnly" />
    </system.web>
</configuration>

由于: MVC3 + WordPress IIS Url重写规则

我发现了窍门:

<rewrite>
    <rules>
        <rule name="wordpress" patternSyntax="Wildcard">
            <match url="*" />
            <conditions logicalGrouping="MatchAll">
                <add input="{PATH_INFO}" pattern="/mymvcapp/*" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php" />
        </rule>     
    </rules>
</rewrite>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM