【发布时间】:2018-10-17 06:11:20
【问题描述】:
我有一个网址
**12.2.2.2:8073/abc=200&&Yr=18&Hr=12&Mi=45&Sec=32**
我想要的是
**10.1.250.153:6180/testapp/rest/?abc=200&&Yr=18&Hr=12&Mi=45&Sec=32**
所以对于这个
RewriteEngine On
LogLevel debug rewrite:trace6
ForensicLog "C:\Apache24\logs\forensic.log"
RewriteRule "^/(.+)$" "http://10.1.250.153:6180/testapp/rest/?$1" [NC,L,P]
ProxyPassReverse "/" "http://10.1.250.153:6180/testapp/rest"
但它不工作,在 ForensicLog 中的 url 是
+4348:5af043cc:0|GET /abc=200&&Yr=18&Hr=12&Mi=45&Sec=32 HTTP/1.1|Host:12.2.2.2:2222%3a8073|Connection:keep-alive|Upgrade-Insecure-Requests:1 |User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml ;q=0.9,image/webp,image/apng,/;q=0.8|Accept-Encoding:gzip, deflate|Accept-Language:en-US,en;q=0.9 -4348:5af043cc:0
知道我在这里可能做错了什么吗?
【问题讨论】:
-
如果上下文是 .htaccess,那么 RewriteRule 针对 never 检查的内容以斜杠开头,因为此时已经去掉了。
-
在规则中添加
NE和/或DPI标志是否有效? -
@Walf 不,它不起作用
标签: mod-rewrite apache2.4