This post will explain how to configure same
short URL/Vanity URL for different sites that is accessible through https in
Adobe CQ5/AEM.
Recently we had a scenario to be implemented,
two different websites needs to be accessed with same URL and with https
protocol.
e.g
https://example1.com/en.html
https://example2.com/en.html
Both the sites are mapped to different nodes as
below
https://example1.com/en.html --> /content/example1/en
https://example2.com/en.html --> /content/example2/en
Create the redirect rules in dispatchers, inside the
corresponding virtual host (httpd.conf) to redirect the http request to https
and to shorten the URL’s .
RewriteRule ^/content/example1/(.*)$ /$1
[NE,L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^/$ https:// example1.com/en.html
RewriteRule ^/en.html https://
example1.com/en.html
RewriteRule ^/en/(.*)$ https://
example1.com/en/$1
Repeat the same for example2.com and for all the dispatchers.
Mapping in publisher :
Go to <<AEM Publisher
Host>>:4503/system/console/configMgr with admin credentials. Search for
Apache Sling Resource Resolver, and change the value of mapping location from
/etc/map to /etc/map.publish