WordPress网站在主目录的子目录加载站点中

时间:2017-11-23 06:20:26

标签: wordpress .htaccess mod-rewrite

我在主目录(public_html)中有两个wordpress site one,另一个在子目录中。我已使用http://example.com/staging配置子目录网站中的所有设置,但是当我加载http://example.com/staging时,它会重定向到主站点中的“未找到页面”,而不是“暂存站点”。我将.htaccess文件设置在staging子目录中,如下所示。

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

# END WordPress

这是在主目录的主站点上。

# 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

任何人都可以帮我解决这个问题,我的暂存网站可以正常加载吗?谢谢你。

0 个答案:

没有答案