Wordpress和Drupal可以在同一域上交付页面

时间:2019-04-26 12:41:09

标签: wordpress .htaccess drupal

我正在同一域名上设置Drupal和wordpress网站。 需要从WordPress交付页面。 如果在wordpress上找不到页面,则从drupal交付页面

RewriteEngine On
RewriteCond %{HTTP_HOST} ^testnew.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.testnew.com$
# Requested resource exists in /am_wordpress
RewriteCond %{DOCUMENT_ROOT}/am_wordpress/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/am_wordpress/$1 -d
RewriteCond %{DOCUMENT_ROOT}/am_wordpress/$1 -l
RewriteRule (.*) /am_wordpress/$1 [S=1]
#
# Requested resource does not exist, do rewrite if it exists in /drupal
RewriteCond %{DOCUMENT_ROOT}/drupal/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/drupal/$1 -d
RewriteCond %{DOCUMENT_ROOT}/drupal/$1 -l
RewriteRule (.*) /drupal/$1 [L]
#RewriteRule ^.*$ /drupal/$1 [NC,L] # Item exists so don't rewrite

0 个答案:

没有答案