http404

If you are using a apache server for your website then there might be a requirement for you to show error pages on http error like 404.This can be easily done using ,htaccess .

In your .htaccess file add the below lines and save to show error pages on Http errors (404, 403 etc)

ErrorDocument 403 /errors/404.html
ErrorDocument 404 /errors/404.html

Here, errors is the folder where you can keep your Http error pages .You can name it whatever you like

Also, if you want to redirect to a particular page if a resource is not found then you can add the below to your .htaccess file

RewriteRule ^ /index.html

Here it loads the index.html page if a resource is not found

Happy coding!