问题原文
原帖链接 · Gustavo Oliveira · CC BY-SA 4.0
I have Apache server where I make my LoadBalancer for my application sereres through proxy and balancermember. Some of my clients come from legacy access, they use a port in the URL example.com:2030 as informed by the old team. So vhost is that way.
<VirtualHost *:80 *:2030>
I would like to force them to just 80 with a redirect to example.com. Is this possible?
已采纳解答
原帖链接 · MrWhite · CC BY-SA 4.0
<VirtualHost *:80 *:2030>
Separate the vHosts, so that port 2030 has its own container and implement a site-wide redirect in that container to port 80 (or HTTPS/443?). For example:
<VirtualHost *:2030>
ServerName example.com
ServerAlias www.example.com
# Redirect everything to port 80
Redirect 301 / http://example.com/
</VirtualHost>
HOWEVER, aren't you using HTTPS (port 443)? Or maybe this is handled by the front-end proxy? In which case the above should redirect to https://.....
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
