php 404 errors code example
Example 1: how to check website 404 status in php
<?php
$url = 'http://google.com';
if(@file_get_contents($url)){
echo "Website is up";
} else {
echo "Website is down";
}
?>
Example 2: php set 404 page
ErrorDocument 400 /400.phpErrorDocument 401 /401.phpErrorDocument 403 /403.phpErrorDocument 404 /404.php #Don't re-add this lineErrorDocument 500 /500.php