Redirection from XML response to external URL | Community
Skip to main content
June 22, 2021
Solved

Redirection from XML response to external URL

  • June 22, 2021
  • 2 replies
  • 2274 views

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?

 

This is xml file

 

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

 

 

 

 

Thanks.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

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! 

2 replies

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
June 22, 2021

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! 

ariesyinnAuthor
June 23, 2021
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"/>