Mod rewrite 使用mod_代理时重写url

Mod rewrite 使用mod_代理时重写url,mod-rewrite,reverse-proxy,mod-proxy,Mod Rewrite,Reverse Proxy,Mod Proxy,我有一个nodejs应用程序运行在:8085上,我使用 ProxyPass /about-us ! ProxyPass /app1 ! ProxyPass / http://test.example.com:8085/ ProxyPassReverse / http://test.example.com:8085/ #The part below doesn't seem to be working RewriteEngine On RewriteCond %{QUERY_STRING} _e

我有一个nodejs应用程序运行在
:8085
上,我使用

ProxyPass /about-us !
ProxyPass /app1 !
ProxyPass / http://test.example.com:8085/
ProxyPassReverse / http://test.example.com:8085/

#The part below doesn't seem to be working
RewriteEngine On
RewriteCond %{QUERY_STRING} _escaped_fragment_=(.*)$
RewriteRule (.*) http://test.example.com:8888/%1? [P]

我想做的是,每当url包含
\u expected\u fragment=
,请求都应该转到运行我的phantomjs服务器的端口
:8888
。但是url没有被重写。

您必须颠倒顺序。首先是例外,然后是更一般的规则。交换块没有帮助:(