【问题标题】:wordpress multisite with sub-domain pretty permalinks带有子域漂亮永久链接的 wordpress 多站点
【发布时间】:2012-10-21 22:01:22
【问题描述】:

我正在尝试建立一个 wordpress (3.4.2) 多站点。当前站点已经应用了以下 apache 规则,我没有编辑权限

<VirtualHost xx.xx.xx.xxx:80>
  ServerName foo.example.nl
  ServerAlias www.foo.example.nl
  DocumentRoot /web/sites/example.nl/foo/www
  RewriteEngine On
<Location />
  Allow from all
</Location>
</VirtualHost>

这很好,但是我发现尝试使用“帖子名称”选项设置永久链接总是会给我一个 404 重定向。 http://foo.example.nl/post1 = 404 未找到

目前我已经卸载了多站点,只是为了尝试让漂亮的 url 与子域一起工作,但是在尝试了很多不同的 .htaccess 变体之后,但似乎没有任何效果。这是当前 .htaccess wordpress 生成的:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>

【问题讨论】:

    标签: wordpress apache .htaccess mod-rewrite


    【解决方案1】:

    不幸的是,您可能无法使用.htaccess 来配置RewriteRules。如果您参考Using "Pretty" Permalinks 上的 Wordpress 文档,您将看到您需要启用Options FollowSymLinks 以及AllowOverride FileinfoAllowOverride All 才能使用.htaccess 中的漂亮URL 配置。由于这些似乎没有设置为您的&lt;VirtualHost&gt;,因此很可能是您的问题,因为它们通常没有在 Apache 配置中设置在更高级别。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-26
      • 1970-01-01
      • 1970-01-01
      • 2015-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多