【问题标题】:htaccess issue with multiple wordpress installed in root and subdirectory在根目录和子目录中安装多个 wordpress 的 htaccess 问题
【发布时间】:2014-11-24 08:01:51
【问题描述】:

我在一台主机上安装了 2 个 wordpress 网站。最初我将它安装在根文件夹中,由于某种原因,我需要在子文件夹中单独安装另一个 wordpress 站点,稍后我将在子域中链接它。虽然我已经成功安装了新的 wordpress,但是我的 htacccess 有问题。

这是我根目录中的 htaccess

# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php

# BEGIN 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>

# END WordPress

这是我在子文件夹中的 htaccess

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

【问题讨论】:

  • “问题”是什么意思?发生了什么不受欢迎的事情?
  • 我的根 wordpress 有永久链接,在访问我的子域站点时,结果为 404,但实际上应用了主题我可以正确访问我的子域/wp-admin。

标签: php wordpress apache .htaccess mod-rewrite


【解决方案1】:

改变

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

到

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    • 2012-01-10
    • 2012-10-08
    • 1970-01-01
    • 2015-04-20
    • 1970-01-01
    相关资源
    最近更新 更多