Forum Moderators: open

Message Too Old, No Replies

'mailto:' coming up as 404 webpage rather than launch mail app

An old problem, but cannot find any reason for this one

         

AlexK

4:18 pm on Mar 29, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



https://www.example.sch.uk/contact-us/

I've ploughed through ~150 school websites, extracting contact details as to enter them into the school entry on OSM (something useful to do whilst in Covid-19 lockdown). No problems until I hit the above webpage. The email address (about halfway down the page - search for 'Enquiries') launches to the following page if clicked:

https://www.example.sch.uk/contact-us/office@huthwaiteallsaints.notts.sch.uk

...and that is a 404 webpage, of course.

The point here is that the html seems fine, my browser (Chromium) is fine, other websites before & after are fine, the w3c validator (https://validator.w3.org/) just gives the normal warnings, so what on earth is wrong with this page?


[edited by: not2easy at 4:42 pm (utc) on Mar 29, 2020]
[edit reason] readability and ToS [/edit]

AlexK

4:28 pm on Mar 29, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The relevant html is:

<p>Tel: <a href="tel:n0123456789">(n012) 3456789</a></br>
Fax: ((n0123) 456789</br>
E-mail: <a href="mailto:office@example.sch.uk">office@example.sch.uk</a></p>


...but the href is coming up as a webpage. Other such links on other school sites are OK before/after this one.


[edited by: not2easy at 4:48 pm (utc) on Mar 29, 2020]
[edit reason] readability, privacy, ToS [/edit]

not2easy

4:52 pm on Mar 29, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sorry I needed to edit the specifics here, we don't discuss actual domains in the public forums. I've attempted to leave the facts while obscuring details.

It appears that the contact information may be inaccessible as they have coded it, but the information is clearly there (office@example.sch.uk) and may not be working correctly for other reasons such as a broken rewrite rule for example.

AlexK

6:52 pm on Mar 29, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ah well. This thread is a waste of time, then. I can speculate myself until the sheep come home, but I wanted other seasoned webmasters to be able to examine the page source-code & possibly find the actual reason for the 404, since I'm out of ideas.

Thanks anyway.

NickMNS

7:16 pm on Mar 29, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The code you posted looks fine, so there is no issue with it. There may be a Javascript onclick event on the link, essentially hijacking the link and directing you to another page that doesn't exist.

AlexK

2:51 am on Mar 30, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The point of the code that I posted is that the html (appears to be) fine - just a standard "mailto:".

Nothing to do with Javascript - switched it off, confirmed with console.trace, & still the 404 comes up (I was working with html in 1998; I know some of this stuff, and none of the obvious applies, and Chrome *Inspect* does not help).

As I said earlier, without someone able to audit the actual page this thread goes nowhere. I've emailed the school to give them a heads-up & referred them to the page writers. I was simply disappointed to be unable to catch the reason for the 404, and hoping for other eyes to set me right.

Once again, thanks for trying to help.

AlexK

4:14 am on Mar 30, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This wretched thing has gotten under my skin & I had to recheck everything again. And this time, the 'mailto:' was missing from the active webpage.

Using wget the mailto section in the Contact page is as follows:

<p>Tel: <a href="tel:0123456789">(0123) 456789</a></br>
Fax: (0123) 456789</br>
E-mail: <a href="mailto:office@example.notts.sch.uk">office@office@example.notts.sch.uk</a></p>


Checking more carefully, the page simply will not load if JS is switched OFF.

Using Inspect (with JS once again active) shows rewritten html:

<p><strong>Telephone:</strong>&nbsp; <strong><span style="color: #ff0000;">0123 456789</span></strong></p>
<p><strong>General E-mail Enquiries:</strong>&nbsp;<a title="office@example.notts.sch.uk" href="office@example.notts.sch.uk" data-ss1585539709="1">office@example.notts.sch.uk</a></p>


It is now plain & simple why the link goes to a 404 webpage, since the HTML rewrite has a boo-boo which rewrites "mailto:office@example.notts.sch.uk" to "office@example.notts.sch.uk", which the browser quite rightly interprets as “GET /contact-us/office@example.notts.sch.uk”. Whoops-a-daisy.

My itch is now scratched. I'll mail the school again to point out why the error is there.

NickMNS

4:27 am on Mar 30, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm glad it worked out!