Hi everyone,
I have a website in AEM Cloud, with custom CDN Imperva (that should be forwarding the header, since is exposing it also in the response section) and my goal is to redirect users based on their country, to the correct site.
Here is what I've done:
RewriteCond %{REQUEST_URI} ^/?$
RewriteCond %{HTTP:X-Aem-Client-Country} ^US$ [NC]
RewriteRule ^.*$ /en-us [R=301,L]
I've tried also with the name of the header in uppercase or lowercase but it changes nothing.
Maybe I'm forgetting something, but the situation right now is that the site is not redirecting to specific homepages when the "root" URL is opened (to be clear: only the site with the domain www.site.com should redirect to www.site.com/en-us if the user is from USA).
Someone has a suggestion about this matter?
Thank you!
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Guglielmo89 ,
Rules seems good however can you give try by making it to uppercase like below
RewriteCond %{REQUEST_URI} ^/?$
RewriteCond %{HTTP:X-AEM-CLIENT-COUNTRY} ^US$
RewriteRule ^/?$ /content/${CONTENT_FOLDER_NAME}/us/en/home.html [PT,L]
and header in lowercase
/headers {
"Cache-Control"
"Content-Disposition"
"Content-Type"
"Expires"
"Last-Modified"
"X-Content-Type-Options"
"x-aem-client-country"
"x-aem-client-continent"
}
Also, under my.vhost, added Vary header to invalidate cache when country header changes if required
<VirtualHost *:80>
<Directory>
# Vary header to invalidate cache when client country changes
Header set Vary "x-aem-client-country"
</Directory>
Thanks
Views
Replies
Total Likes
Hi, thank you for your suggestions but I've already tried to add those configurations with uppercase/lowercase and tried also other combinations. None of them had success
Views
Replies
Total Likes