Redirect URL with query string parameters
When creating a redirect URL using "This page redirects to another page" and selecting external URL, any query string parameters added to the Sitefinity URL are lost after redirecting to the destination URL. I tried creating a code-behind and overriding the OnLoad event and getting the current page using SiteMapBase.GetActualCurrentNode() so I could programmatically set the RedirectUrl property, but that property only has a getter.
I also tried setting a variable with the RedirectUrl value, appending my query string parameters to it and Response.RedirectPermanent using that variable value, but it appears that Sitefinity redirect value takes precedence over my redirect.
Hi Neil
You can use a normal page with a javascript widget.
The javascript code is
if
(window.location.pathname.indexOf(
"/Action/Edit"
) == -1)
window.location.href =
"http://url"
+ window.location.search;
Jonata
Hello Neil,
We have provided an answer for you in the support ticket you had opened for this topic. Feel free to share the information with the rest of the community as well.
What is the resolution here? I have the same issue.
Hello Elan,
The behavior that is experienced with the redirect is the default one, which means that query strings will not be passed down. We do have this Feature Request open in our Feedback Portal, which you can vote on in order to increase its prioritization.
Additionally, you may also use the Javascript code provided by Jonata previously to achieve a similar functionality.
Regards,
Angel Moret
Telerik
Hi Angel,
Has this been resolved? I need query string parameters to stay with the visitor at all time s even if redirected, can you provide feedback?