根据 webmasterworld 的吉姆(谢谢!)
“[P] 标志在指定 URL 处向服务器调用反向代理请求;也就是说,它打开一个新的传出 HTTP 连接并向该服务器发送请求。因此,至少,您的配置是两次尽可能慢,只使用原始的工作规则,因为您的服务器正在通过 HTTP 向自己发送一个新请求,而不是仅仅从非默认映射的文件路径中提供内容。
在我看来,所需要的只是内部重写,以便对 URL
http://dev.example.edu/distribution/上的资源的请求由服务器文件路径 /distribution/index 处的脚本生成的内容提供服务.php/分布/"
RewriteEngine on
#
# Return 403-Forbidden response to TRACE requests
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
#
# Internally rewrite requests for URL-path /recreation/<anything>
# to filepath /eel/index.php/recreation/<anything>
RewriteCond %{HTTP_HOST} ^dev\.example\.edu [NC]
RewriteRule ^/recreation/(.*)$ /ee1/index.php/recreation/$1 [L]
#
# Internally rewrite requests for URL-path /distribution/<anything>
# to filepath /distribution/index.php/distribution/<anything>
RewriteCond %{HTTP_HOST} ^dev\.example\.edu [NC]
RewriteRule ^/distribution/(.*)$ /distribution/index.php/distribution/$1 [L]
所以我认为我只是让它变得比它必须的更复杂。我已经删除了 P 标志并从重写器中删除了完整的服务器地址。