gpt4 book ai didi

URL 的 apache 重写规则

转载 作者:行者123 更新时间:2023-11-28 23:39:37 26 4
gpt4 key购买 nike

我的 java 应用程序部署在 tomcat 上,我正在使用 apache 的重写规则来访问使用 apache 的应用程序。我的应用名为my.war,部署在tomcat/webapps/my/

我在 httpd.conf 中使用以下重写规则

    RewriteEngine On
ProxyPreserveHost On

RewriteRule ^/$ \
http://localhost:8082/my [P]

RewriteRule ^/(my/.*)$ \
http://localhost:8082/$1 [P,R,L]

当我打开 www.mydomain.com/时,它将 url 更改为 www.mydomain.com/my/我不想要这个,我想要 url 是 www.mydomain.com/并且它应该打开我的应用程序的登录页面。

最佳答案

您应该改用 mod_proxy 的 ProxyPass:

ProxyPass / http://localhost:8082/my/

关于URL 的 apache 重写规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21255022/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com