I have multiple hostnames resolving to a single machine, e.g.:
- build.mydomain.com
- www.mydomain.com
- jira.mydomain.com
- mydomain.com
Is it possible to setup apache in order to redirect requests to each different hostname?
e.g:
- build.mydomain.com -> build.mydomain.com:8111,
- www.mydomain.com -> www.mydomain.com:8080
- mydomain.com -> www.mydomain.com:8080
The DNS records are setup to all point to the same machine, i just want to redirect to the right port given the hostname.
Cheers,
Edit:
Machine is debian w/ Apache2
Edit2:
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
redirect 301 / http://www.mydomain.com:8080/
</VirtualHost>
<VirtualHost *:80>
ServerName build.mydomain.com
redirect 301 / http://build.mydomain.com:8111/
</VirtualHost>