Add support for VirtualHost redirects
It would be nice to be able to have something like this YAML:
apache_vhost_redirects:
- name: example.org
alias:
- www.example.org
ports:
- 80
status: permanent
dest: https://example.com/
- name: example.co.uk
alias:
- www.example.org.uk
- example.co.uk
- www.example.co.uk
- example.uk
- www.example.co.uk
ports:
- 80
status: 303
dest: https://example.com/uk
To generate:
<VirtualHost *:80>
ServerName example.org
ServerAliases www.example.org
Redirect permanent / https://example.com/
</VirtualHost>
<VirtualHost *:80>
ServerName example.co.uk
ServerAlias www.example.org www.example.org.uk example.co.uk www.example.co.uk example.uk www.example.co.uk
Redirect 303 / https://example.com/uk
</VirtualHost>
See the Redirect documentation.
If these just generate redirects for the whole domain, /
, then they don't need a DocumentRoot
etc, however the Lets' Encrypt config would also be needed for port 443
.