I’ve often been called a hack my lack of any formal education in this matter is certainly proof of this.
Inspecting your example in Chrome dev tools shows that when linking to a bad url in your site a 302 is generated.
A 302 is a temporary redirect as opposed to a 301 permanent redirect. Though I have zero ideas what is triggering that 302 response, it does explain why your example works (because it is redirecting).
Another thing to consider here is whether the 404 page is returning a 404 http header. If not, it’s not set up correctly. You can check it here https://httpstatus.io
That’s right Neil. Any bad link in his site generates a 302 as opposed to a 404.
Even though he clearly is accounting for a 404 in the htaccess file and there is nothing in that file obvious to me that would trigger a 302 instead. Mystery.
But at the end of the day, what every the mystery, a bad link there re-directs to the 404 just as my proposed hack, so all is well.
It is a mystery @Doobox.
It’s not good either, according to Google.
No matter how beautiful and useful your custom 404 page, you probably don’t want it to appear in Google search results. In order to prevent 404 pages from being indexed by Google and other search engines, make sure that your webserver returns an actual 404 HTTP status code when a missing page is requested.
Perhaps the addition of:
<meta name="robots" content="noindex,nofollow>
In the actual 404 page created in RW.
It has to be a trade-off.
The only “real” solution is to ensure that there are no relative links in the 404.html, but this can not be achieved in RW and RW alone.
Every other solution (including mine), I’d consider a hack.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.