我正在同一域名上设置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