Problems with & in URLs

Hi,

I am having problems with URLs that contain & in them. These URLs are not working properly when a client clicks on the generated Campaign Monitor link, because the forwarding provided by CM simply forwards to the link in the HTML document. This appears to only have started happening last week.

For example, this is link as it appears in the HTML source of my document:

<a href="http://www.pifonline.org.uk/?o=1097&amp;newsitem=4461">

When you click on this link in a browser, the browser correctly transforms this link into:

http://www.pifonline.org.uk/?o=1097&newsitem=4461

However when a user clicks on the link generated for this link in the CM generated email CM redirects the user to:

http://www.pifonline.org.uk/?o=1097&amp;newsitem=4461

Which fails. For me this is definitely an issue with CMs forwarding mechanism, as the link in the source is valid HTML. I have raised this issue with support but their reply was to write the link as follows:

<a href="http://www.pifonline.org.uk/?o=1097&newsitem=4461">

This however is invalid (the page will not render) if used in an XHTML document and not recommended by the w3c even in an HTML document.

My solution for now is to encode the & as such:

http://www.pifonline.org.uk/?o=1097%26newsitem=4461

But this is not a nice solution from my point of view as it means rewriting all my templates across various clients.

Please can you let me know if I am doing something obviously wrong here or if this indeed an issue with CM?

Thanks,
Robin

Diana Diana, 7 years ago

Hey Robin,

Sorry about all the confusion. Looks like we'd fixed it at some point so that &amp; was being converted to & but that's not working now. We're working on a fix (and let you know via support).


~*~~*~~*~~*~
D. Potter
Campaign Monitor

Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098