【问题标题】:Wordpress blog inside another [permalinks]另一个 [永久链接] 中的 Wordpress 博客
【发布时间】:2012-11-03 10:27:28
【问题描述】:

我有一个关于在同一主机上同时拥有两个博客的问题。这是我的场景: 第一个博客托管在根目录http://mathosproject.com/,第二个托管在一个子目录http://blog.mathosproject.com/,它链接到http://mathosproject.com/blog/

我试图操纵根目录的 web.config 文件,将其排除在目录 blog 之外,如下所示:

    <configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="wordpress8" patternSyntax="Wildcard">
          <match url="^(blog|sample-page)*" ignoreCase="true" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/(blog|index)" negate="true" />
          </conditions>
          <action type="Rewrite" url="blog/index.php" />
        </rule>

        <rule name="wordpress" patternSyntax="Wildcard">
          <match url="*" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/(blog|index)" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" />

        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

这实际上帮助我能够在 blog 中查看第二个博客,但是当我处理到 sample-page 时,我被重定向到第一个博客.

我的问题是,有没有办法可以配置 web.config,使其完全排除文件夹?

提前谢谢你,

阿尔乔姆

【问题讨论】:

    标签: wordpress iis web-config


    【解决方案1】:

    我想这太晚了,但有答案所以发布它。

    在子目录 blog 中,编辑 web.config 并将 &lt;Clear/&gt; 放在 &lt;rules&gt; 元素之后。 这将使您的两个博客都能正常工作。

    【讨论】:

      猜你喜欢
      • 2010-11-22
      • 1970-01-01
      • 1970-01-01
      • 2015-05-05
      • 1970-01-01
      • 2017-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多