我需要在proxyPass和proxyPassReverse
中使用以下重写规则RewriteEngine On
RewriteRule ^(market|stock|mutual)$ stackoverflow/$1 [L]
我的虚拟主机定义是
<VirtualHost *>
ServerName localhost
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
我应该在哪里插入重写规则,以便当我点击URL - localhost / market时,它将对localhost执行内部重写:8080 / stackoverflow / market
请帮忙
答案 0 :(得分:2)
搞定了
<VirtualHost *>
ServerName localhost
ProxyPass / http://localhost:8080/stackoverflow/
ProxyPassReverse / http://localhost:8080/stackoverflow/
RewriteEngine On
RewriteRule ^(market|stock|mutual)$ stackoverflow/$1 [L]
</VirtualHost>