redirection in xml

Avatar

Avatar
Boost 1
Level 1
ariesyinn
Level 1

Like

1 like

Total Posts

33 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Validate 1
View profile

Avatar
Boost 1
Level 1
ariesyinn
Level 1

Like

1 like

Total Posts

33 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Validate 1
View profile
ariesyinn
Level 1

22-06-2021

Hi all,

I have a xml page. Instead of showing xml response, I want to redirect to external page.

How can I do auto redirection in .xml file?

ariesyinn_0-1624350987344.png

 

This is xml file

ariesyinn_0-1624355513192.png

 

I used JavaScript redirection code, but, i doesn't redirect and appears as shown below.

ariesyinn_1-1624355637931.png

 

 

 

 

Thanks.

 

View Entire Topic

Avatar

Avatar
Boost 5
Level 7
Ritesh_M
Level 7

Likes

179 likes

Total Posts

142 posts

Correct reply

44 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Level 7
Ritesh_M
Level 7

Likes

179 likes

Total Posts

142 posts

Correct reply

44 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
Ritesh_M
Level 7

22-06-2021

Hi @ariesyinn ,

The requirement is not clear. Do you have this as component in which you are showing XML response? Though, I will try to answer based on what I understood.

 

1. If the XML is coming via a component then you can simply create a Clientlib and write a jQuery on load event which can just redirect to another page. Add the Clientlib on your component HTML.

 

window.location.href = "http://www.w3schools.com";

 

2. You can also write a redirect on dispatcher using rules.

 

3. You can also create a page using  with sling:resourceType=foundation/components/redirect and configure the properties-

     Open page properties, and add the redirect url.

https://www.aemquickstart.in/2016/11/external-redirect-for-aem-page.html

 

Hope it helps!