I want to display different content depending on the value of X-Forwarded-Host.
■Implementation I want to perform
I want to deliver different content within AEM as a Cloud based on the value of X-Forwarded-Host.
For example, when accessing the URL “https://publish-pxxxx-exxxxx.adobeaemcloud.com/test1/test2.html”:
1. If X-Forwarded-Host: aaa.co.jp, return the content of /content/AAA/test1/test2.
2. If X-Forwarded-Host: bbb.co.jp, return the content of /content/BBB/test1/test2.
■What I tried
I added the following settings to the “/dispatcher/src/cond.d/rewrites/rewite.rules” file:
RewriteCond %{HTTP:X-Forwarded-Host} ^AAA.co.jp$
RewriteRule ^/?(.*)$ /content/AAA$1 [PT,L]
RewriteCond %{HTTP:X-Forwarded-Host} ^BBB.co.jp$
RewriteRule ^/?(.*)$ /content/BBB$1 [PT,L]
However, the above settings did not work properly.
I suspect that the reason might be that X-Forwarded-Host is not recognized by the dispatcher, but I am not certain.
■Questions
Please let me know if you know the cause why it does not work, or any alternative solution.