Php WordPress:一个网站名下有两个WP站点。htaccess应该是什么样子?

Php WordPress:一个网站名下有两个WP站点。htaccess应该是什么样子?,php,wordpress,Php,Wordpress,我有两个WP站点: site.com/&site.com/de/ # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /de/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /de/index.php [L]

我有两个WP站点: site.com/&site.com/de/

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

# END WordPress
这些站点具有独立的DB和WP核心

选项siteurl的第二个DB的值为site.com/de/。 我还将site.com/.htaccess更改为:

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

# END WordPress 
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^de/*$/de/index.php[L]
重写规则/index.php[L]
#结束WordPress

但它不起作用。我得到404错误。我在htaccess中哪里错了?

通常我们不应该做任何事情

(我很高兴:) 我会这样做:

在www.site.com上:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName nextrr.de
AuthUserFile /home/chris/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/chris/public_html/_vti_pvt/service.grp
#-FrontPage-
IndexIgnore.htaccess*/.??**~*#*/HEADER**/README**/\u vti*
命令拒绝,允许
全盘否定
通融
命令拒绝,允许
全盘否定
AuthName nextrr.de
AuthUserFile/home/chris/public_html/_vti_pvt/service.pwd
AuthGroupFile/home/chris/public_html/_vti_pvt/service.grp
并在site.com/de/

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

# END WordPress
#开始WordPress
重新启动发动机
重写基/de/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/de/index.php[L]
#结束WordPress

我认为你不应该自己做任何事情,我已经在类似的情况下安装了很多次wp,而且什么都不用做。哦,我的错。我没有改变家庭选择。现在它工作完美!谢谢大家!