I am working on a POC focused on migrating a large set of cross-domain redirects to AEM as a Cloud Service. My organization currently operates two websites:
The redirect rules for Website B aim to redirect its pages to equivalent or related pages on Website A. This setup requires cross-domain redirects from Website B’s domain to Website A’s domain.
Any guidance on best practices and configurations for handling cross-domain redirects in this setup would be highly appreciated.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
The issue was resolved by implementing a two-way redirect rule. We configured a CDN rule in the CDN.yaml file to redirect all requests from Website B to Website A in the specified format. Additionally, we used the Redirect Manager to set up internal rules. This approach allows us to handle approximately 5000 redirects individually without needing a common regex pattern for the paths.
The key requirement for this setup is that Website B must route through the AEM Managed CDN for the redirection rules to function correctly. Once this is in place, the traffic will be redirected as expected.
redirects:
rules:
- name: redirect-cross-domain
when:
reqProperty: domain
equals: website-b-domain
action:
type: redirect
status: 301
location:
reqProperty: path
transform:
- op: replace
match: '^/(.*)$'
replacement: '<https://website-a-domain/webiste-b-com/\1.html'>
AEM documentation for redirects is https://experienceleague.adobe.com/en/docs/experience-manager-learn/foundation/administration/url-re...
Maybe I am not getting your problem, but as long as you need to redirect only from the Wordpress hosted pages to the AEM hosted pages, why would you need to setup any redirects within AEM ? Aren't they suppose to be configured only in Wordpress ?
Hi @saumyaj49332255,
since the site you are redirecting to is not on AEM, it would be best to use CDN redirects: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/con...
It doesn't really make sense to hit origin (AEM/Dispatcher) and then redirect to another origin. However, given the large number of redirects you need, please be aware that the max size of the OOTB Adobe CDN configuration file cannot exceed 100 KB. Therefore, you need to check if this is enough for you and allows you some space to grow.
In case you are using a custom CDN, then you don't have this problem and you should definitely go with CDN redirects.
Hope this helps,
Daniel
@daniel-strmecki
I am still confused. The aim was:
"The redirect rules for Website B aim to redirect its pages to equivalent or related pages on Website A. This setup requires cross-domain redirects from Website B’s domain to Website A’s domain."
Why do we need to setup any redirects in AEM CDN ?
Hey @daniel-strmecki @Tethich ,
Thank you for your response!
Yes, I understand the requirement might seem unusual, but since we’re working on setting up a CDN on AEM Cloud, the client is also requesting if these redirects can be managed directly from the AEM side.
There are around 5000 redirects involved, so the client is looking for a solution within AEM that is scalable, easy to use, and author-friendly.
The use case is still ambiguous to me. Maybe you can share an infra diagram to understand better.
However, as I said, these are the available options for you to explore when it comes to redirects:
https://experienceleague.adobe.com/en/docs/experience-manager-learn/foundation/administration/url-re...
You already tried Redirect Map Manager and Redirect Manager, so these are out of scope.
You said you have more then 5000 redirects to manage, so using Page Redirect Property is also out of scope, as you can't manually handle this.
You are then left with managing this at AEM level using cdn.yaml as @daniel-strmecki suggested, or at edge level if you have other CDN then Fastly, like Akamai Edge Redirector or AWS CloudFront Functions.
And you can always use mod-rewrite in Dispatcher, but this is again a tedious work.
With DNS mapping, a domain can either be pointed to a single domain (CNAME) or to a set of IP addresses (A-Record). From my understanding, the domain for Website B may currently point to your WordPress server or a CDN/load balancer, while Website A points to AEM as a Cloud CDN.
Ideally, redirects from Website B URLs to Website A URLs should be managed on the server or CDN handling Website B.
If it’s necessary for AEM as a Cloud platform to manage these redirects, you could proxy Website B through AEM as a Cloud CDN. This would allow requests for Website B URLs to be directed to the WordPress platform, while other redirects could be managed within AEM, assuming a recognizable pattern to distinguish these requests.
For more information, refer to Configuring Traffic at the CDN | Adobe Experience Manager.
Several approaches are available for enabling redirects:
Regards,
Albin
https://myprofile.albinsblog.com
@saumyaj49332255 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Hey @kautuk_sahni - Yes shared the approach that we followed.
The issue was resolved by implementing a two-way redirect rule. We configured a CDN rule in the CDN.yaml file to redirect all requests from Website B to Website A in the specified format. Additionally, we used the Redirect Manager to set up internal rules. This approach allows us to handle approximately 5000 redirects individually without needing a common regex pattern for the paths.
The key requirement for this setup is that Website B must route through the AEM Managed CDN for the redirection rules to function correctly. Once this is in place, the traffic will be redirected as expected.
redirects:
rules:
- name: redirect-cross-domain
when:
reqProperty: domain
equals: website-b-domain
action:
type: redirect
status: 301
location:
reqProperty: path
transform:
- op: replace
match: '^/(.*)$'
replacement: '<https://website-a-domain/webiste-b-com/\1.html'>
Views
Likes
Replies