I have set 2 different port with subdomain on each port. For example: port 8080 -> a.example.com and port 8081 -> b.example.com. But when I try to open a.example.com:8081 the browser loads the b.example.com:8081 web page (but the url not changing to b.example.com:8081) and vice versa. How to redirect to the correct port/subdomain, if we open a.example.com:8081 then it will automatically redirect to a.example.com:8080 or maybe to b.example.com:8081?
I am using Apache 2.4 and my vshost:
<VirtualHost *:8080>
ServerName a.example.com
DocumentRoot D:/xampp/htdocs/a
</VirtualHost>
<VirtualHost *:8081>
ServerName b.example.com
DocumentRoot D:/xampp/htdocs/b
</VirtualHost>