I want to see 404 pages of browser standard

Asked 2 years ago, Updated 2 years ago, 80 views

■Environment
I'm building a site on wordpress, but except for the URL created for membership only
I'd like to see 404 pages that my browser spouts as a standard.

■ What I tried
If you write the following in the template,

<?php
/*
Template Name:test
*/
header("HTTP/1.1404 Not Found");
?>

The page appears white.

<?php
/*
Template Name:test
*/
?>

It will be displayed as white here as well.

Delete 404.php and delete browser cache
I tried to display it, but the page 404.php appears.
(Is there a cache left on the browser side or is it being processed by the wordpress core?)
Are Google caches displayed?)

There are many ways to create the original 404 page, but
I couldn't find a way to intentionally display the 404 that the browser spouts normally.

ブラウザThe 404 that the browser spouts as a standard is
When accessing URLs that do not exist in IE and Chrome
The display of 404 is different, but it is the 404 page of the original.

Is php possible if we want to do this?
Or do I need to set it up in apache?

php apache wordpress http

2022-09-30 20:12

2 Answers

It depends on the browser implementation, but I looked into it a little bit.

If the response page size is 512 bytes or less in Internet Explorer, stackoverflow - Custom error page does not appear in IE: 404 pages on the browser side are displayed as described in .(However, you can change your settings to display server-side content.)

Google Chrome seems to do it via the API stackoverflow-Change Chrome 4xx Page, as described in chrome.webNavigation, but the hurdle seems to be high.


2022-09-30 20:12

The server response in case of an error is

HTTP/1.0404 Not Found

After the

<HTML><HEAD>
<TITLE>404 Not Found</TITLE>

…and ….

This content is
for example, apache. /error/HTTP_NOT_FOUND.html.var
stored in the .

Depending on the browser, you can see the unique thing by looking at Status code 404
This is a case of ignoring the provided HTML.


2022-09-30 20:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.