0

我有 WordPress 网站并在其中安装了另一个站点的子目录。子网站的所有子页面都有 URL 404 问题(安装在子目录中)

它正在加载子网站的登录页面,但一旦尝试访问任何页面或发布它就会给出 404 错误。这个 CMS 有自己的 .htaccess。

Path:
Wordpress: wp/.htaccess
QA:        wp/qa/.htaccess

WordPress .htaccess 代码

# 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

QA .htaccess 代码

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

我对重写规则了解不多,所以请帮我解决这个问题。百万谢谢

4

1 回答 1

2

尝试将 QA .htaccess 更改为此:

DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /qa/
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /qa/index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>
于 2013-02-01T18:22:40.960 回答