Creating a Custom 404 Error Page with Redirection to the Home Page or Any URL

In this video, we will learn to create custom 400 401 403 404 500 Error Pages and Hoe can we auto Redirect to Home Page Index.html Index.php Index.htm or URL
A 404 error indicates that the server itself was found, but that the server was not able to retrieve the requested page. History. The origin of the 404 error
This video discusses how to use your .htaccess file to create automatic redirects for any HTTP Status code.

Remember that if you want to redirect for permission reasons then the error document must be in a location that has no permission restrictions.

If you want, you can make your custom error page a PHP file and add some dynamic functionality by using the actual URL that the user submitted to cause the redirect to home.

**** Source Codes ****
#### .htaccess

ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php

#### Java Script for Redirect to HomePage

location.href=”ENTER FILE-NAME.EXT OR URL”
} , 5000);

setTimeout(function(){location.href=”index.html”} , 5000);

Same Procedure for All Three Types of file HTML PHP HTM

Watch Remove File Extensions Using .htaccess Hide .HTML .PHP .HTM From Page URL | Rewrite URL Source Codes

• Remove File Exten…

#Custom_Error_Page #400 #401 #403 #404 #500 #Error #htaccess #Redirect #Home_page #Java #Script #html #php #htm

Leave a Reply