Search code examples
htmlemailhtml-email

<a href gets downloaded when in an E-Mail, but in a browser receive HTTP Status 403


I have an email with content type text/html. Withing it, I have a reference like this:

<a href="https://appl04.edireal.com/mediawrapper/servlet/Media?offerId=10690569&amp;offerCode=1595601971823&amp;offerIndex=0" style="color: #DC1C2E">RE/MAX Angebot 2848-1077: PREISREDUKTION! Neues Reihenhaus im Seepark Vösendorf..pdf</a>

When I open this email from gmail or another browser-based E-Mail client and click upon the link, the content gets downloaded as a PDF resource.

However, when I paste the href in a browser address bar and try to access it, I receive the message

Status report

description Access to the specified resource () has been forbidden.

Any help here


Solution

  • The ampersands & in the URL have been replaced with the appropriate XML entity &amp;.

    Therefore, if you want to use that HTML attribute (the href value) in a context that isn't XML or HTML (i.e., your address bar), you need to undo this replacement. So, replace &amp; with &:

    https://appl04.edireal.com/mediawrapper/servlet/Media?offerId=10690569&offerCode=1595601971823&offerIndex=0