Im a beginner at all this. Want to create a custom 404 error page which would display this image and simply redirect the user to the homepage within 5 seconds of seeing the error. Can someone help me out with the coding and how I should go about it? Im gonna upload it through the cPanel. My server is linux Thanks a bunch!
Hosting companies provide this feature. You need to find the option in your hosting account. You can create an .htaccess file and put it in your main website directory. The .htaccess file should have the tag for 404 pages. See sample of .htaccess file given below. After the # Not found Error# tag you are telling the server the location of 404 page - # $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $ # # This is used with Apache WebServers # # For this to work, you must include the parameter 'Options' to # the AllowOverride configuration # # Example: # # <Directory "/usr/local/apache/htdocs"> # AllowOverride Options # </Directory> # # 'All' with also work. (This configuration is in the # apache/conf/httpd.conf file) # The following makes adjustments to the SSL protocol for Internet # Explorer browsers <IfModule mod_setenvif.c> <IfDefine SSL> SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 </IfDefine> </IfModule> # If Search Engine Friendly URLs do not work, try enabling the # following Apache configuration parameter # # AcceptPathInfo On # Fix certain PHP values # (commented out by default to prevent errors occuring on certain # servers) # #<IfModule mod_php4.c> # php_value session.use_trans_sid 0 # php_value register_globals 1 #</IfModule> # Ensure www on all URLs. RewriteCond %{HTTP_HOST} ^purplesale.com [NC] RewriteRule ^(.*)$ http://www.purplesale.com/$1 [L,R=301] # re-direct index.html to root / # RewriteCond %{THE_REQUEST} ^.*\/index\.html\ HTTP/ RewriteRule ^(.*)index\.html$ /$1 [R=301,L] # Not found Error# ErrorDocument 404 /resource-unavailable.html # Custom Error page# ErrorDocument 403 /custom-error.html
Do not automatically re-direct to the home page or any other page. If there is a problem on the server that prevents serving of the home page you will put the browser in a re-direction loop until the browser detects it and notifies the user of a hard error. Put a link to the home page so the user initiates the action. Cd&