While creating 404 error page the page contents of other pages can be modified and it is created . But how to do it?
After creating 404 error pages , explain how to redirect it.
How to rectify the broken links?
While creating 404 error page the page contents of other pages can be modified and it is created . But how to do it?
After creating 404 error pages , explain how to redirect it.
How to rectify the broken links?
Custom Error Page with Apache 2.2+ and PHP
.htaccess or vhost settings:
# in .htaccess you need AllowOverride in the /error directory
ErrorDocument 404 /error/404.php
Custom Error Page with Nginx and PHP
add the part below in your nginx server config like: (/usr/local/nginx/conf/nginx.conf)
error_page 404 /404.php;
location /404.php {
internal;
}
Custom Error Page with lighttpd and PHP
add the script below in your lighttpd config:
server.errorfile-prefix = "/srv/www/htdocs/errors/status-"
and make error pages with the syntax like:
/srv/www/htdocs/errors/status-404.php
/srv/www/htdocs/errors/status-500.php
404.php
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
echo 'The Page'. $_SERVER["HTTP_REFERER"]. ' cannot be found!';
More Infos about this