Hello Community - I need your suggestion related to etc/map redirect. I am trying to implement the below redirect
PS: We don't want to make any changes in Apache.
DNS: www.prepaid.test.com/prepaidcards/student.html -> www.prepaid.test.com/content/test/en/account/cardenrollment.html
Existing setup is CDN -> Dispatcher -> Publish Instance
I have the following entries but the redirect is not happening. I have also verified in /system/console/jcrresolver. I wanted to implement it as a 301 redirect. Are these entries correct?
Also I have another question. I have kept the domain name for sling:Mapping. is that something that we need to follow the exact name of the domain/website or we can have any name? Also do I need to specify the port no. in the node name or not? Please advise.
Solved! Go to Solution.
Views
Replies
Total Likes
Are you trying for an external redirect(sling:redirect) or internal rewrite(sling:internalRedirect)? Also check AEM is reciving direct HTTPS traffic or X-Forwarded* headers, if not create the et/map configurations under HTTP node.
Refer to https://medium.com/tech-learnings/adobe-experience-manager-aem-implementing-custom-redirect-vanity-u... for more details.
Refer to https://techforum.medium.com/configure-sling-mapping-for-resource-resolution-in-adobe-experience-man... for more details on enabling etc/mapping.
Regards
Albin I
You can add a rewrite rule in Apache to do a 301 redirect. Why you are not using Apache/Web server for rewrite ?
Are you trying for an external redirect(sling:redirect) or internal rewrite(sling:internalRedirect)? Also check AEM is reciving direct HTTPS traffic or X-Forwarded* headers, if not create the et/map configurations under HTTP node.
Refer to https://medium.com/tech-learnings/adobe-experience-manager-aem-implementing-custom-redirect-vanity-u... for more details.
Refer to https://techforum.medium.com/configure-sling-mapping-for-resource-resolution-in-adobe-experience-man... for more details on enabling etc/mapping.
Regards
Albin I
Try to modify the sling:match as sling:match - prepaidcards/student.html (removed the slash). Also, note sling:redirect instead of sling:internalRedirect with complete URL should used if you want to redirect the user to specific URL in browser.
Working JSON
{
"jcr:primaryType": "sling:Folder",
"jcr:createdBy": "admin",
"hidden": "true",
"jcr:created": "Wed Oct 16 2019 20:55:35 GMT-0500",
"http": {
"jcr:primaryType": "sling:Folder",
"jcr:createdBy": "admin",
"jcr:created": "Wed Oct 16 2019 20:55:35 GMT-0500",
"prepaid.test.com": {
"jcr:primaryType": "sling:Mapping",
"jcr:createdBy": "admin",
"jcr:created": "Wed Jan 06 2021 12:45:10 GMT-0600",
"test-redirect": {
"jcr:primaryType": "sling:Mapping",
"jcr:createdBy": "admin",
"sling:redirect": "https://www.albinsblog.com",
"jcr:created": "Wed Jan 06 2021 12:46:07 GMT-0600",
"sling:match": "prepaidcards/student.html"
}
}
}
}
Hi @v1101,
1. In your sling:internalRedirect, I think you have missed the "/". Please add it and try again.
2. In general, we add the sling:Mapping node in sling:Folder node which holds the domain name.
Hope this helps.
Thanks,
Kiran Vedantam.
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies