Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Redirection from XML response to external URL

ariesyinn
Level 3
Level 3

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.

 

1 Accepted Solution
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

Hi @ariesyinn 

 

In your previous post I mentioned the same solution of adding the redirect at the dispatcher i.e. at your webserver end. Let's say end user is trying to access www.anything.com/whateverxmlpath.xml and I want them to redirect to https://www.anywhereyouwant.com then the below rules will work.

 

RewriteCond %{REQUEST_URI} ^/whatverxmlpath.xml$
RewriteRule (.*) https://www.anywhereyouwant.com [R=301,L]

 

What is your request URL? Please provide the exact request URL that end user will be accessing and where you want the user to redirect i.e. the destination URL. I can provide the exact rule that you need to put on dispatcher and it will resolve the redirection issue.

 

Thanks! 

View solution in original post

2 Replies
asutosh_jena
Correct answer by
Community Advisor
Community Advisor

Hi @ariesyinn 

 

In your previous post I mentioned the same solution of adding the redirect at the dispatcher i.e. at your webserver end. Let's say end user is trying to access www.anything.com/whateverxmlpath.xml and I want them to redirect to https://www.anywhereyouwant.com then the below rules will work.

 

RewriteCond %{REQUEST_URI} ^/whatverxmlpath.xml$
RewriteRule (.*) https://www.anywhereyouwant.com [R=301,L]

 

What is your request URL? Please provide the exact request URL that end user will be accessing and where you want the user to redirect i.e. the destination URL. I can provide the exact rule that you need to put on dispatcher and it will resolve the redirection issue.

 

Thanks! 

View solution in original post

ariesyinn
Level 3
Level 3
I managed to solved it in client side by adding <xhtml:script xmlns:xhtml=http://www.w3.org/1999/xhtml src="<your file>.js" type="application/javascript"/>