我正在使用与JBoss集成的Apache Web服务器“httpd-2.4.25-win64-VC14”。端口重定向工作正常。现在我想根据一些条件来替换URL,比如说,如果URL包含'Mobile'
,那么我想用'Mobile/web'
替换它并转发它。根据条件Apache Httpd.conf重定向URL
为此,我在<VirtualHost>
标记中使用了<Directory>
标记。现在,我发现的大多数在线参考文献都在标记前加上了URL,例如'var/www/example'
,但我想根据localhost
重定向,因为我在本地运行Jboss。
所以,我应该怎么写的标签内容,我试着用下面的
<VirtualHost *:80>
<Directory /var/www/example/>
Allow From All
RewriteEngine On
RewriteCond %{QUERY_STRING} (manage)
RewriteRule ^Mobile http://%{HTTP_HOST}/Mobile/web=%1 [NC,L]
</Directory>
</VirtualHost>
像http://localhost:8081/Mobile/register
应http://localhost:8081/Mobile/web/register
更换,请推荐