how to redirect non WWW to WWW with AEM cloud?
The vhost file only seems to support http (non SSL) traffic.
We want to have:
http://ourdomain.com -> https://www.ourdomain.com
https://ourdomain.com - > https://www.ourdomain.com
https://ourdomain.com/something.html -> https://www.ourdomain.com/something.html.
etc.
We would guess something like this would be a start:
<VirtualHost *:80>
ServerName ourdomain.com
Redirect permanent / http://www.ourdomain.com/
</VirtualHost>
<VirtualHost *:80>
ServerName www.ourdoamain.com
--- real stuff
but what about https?
We could also consider using rewrite rules, but should they be to http or https?
e.g.
RewriteCond %{HTTP_HOST} ^ourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.ourdomain.com/$1 [R=301,L]
OR:
RewriteCond %{HTTP_HOST} ^ourdomain\.com$ [NC]
RewriteRule ^(.*)$ https://www.ourdomain.com/$1 [R=301,L]We are going from non www to www as it gives us more options around CNAMES which are not supported at Apex, and make it harder to use Azure traffic manager to put up holding pages when AEM cloud is down.