我有以下Apache VirtualHostconfiguration:
<VirtualHost 192.0.2.1:80 [2001:DB8:4007:80d::200e]:80> ServerName app.example.com ServerAlias foo.example.com ServerAlias bar.example.com ... other server aliases ... ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost>
我想(暂时)将http://foo.example.com/redirect到http://foo.example.com/path/foo/resource ,更一般地说:
http://${sub}.example.com/ > http://${sub}.example.com/path/${sub}/resource
什么是最好的办法呢? 如果这是不可能的,我不介意为每个ServerAlias编写一个规则。