Now we will discuss how to set 404 error page using a .htaccess file. Today I will tell you how to setting a custom 404 page through the .htaccess file.
Now just see how to create a custom 404 error page and set it via .htaccess file. You can redirect any URL using .htaccess file. So now we will create custom 404 page and set it when user will access those pages which are not available on your site. Then they will get that created custom 404 page which you have set it via .htaccess file.
Here you can place any type of image and links. This is called custom 404 error page creation. If you are getting 404 error then here I have mentioned fixing 404 error not found pages. If you are a user of WordPress then you can install and activate WP Fastest Cache Plugin to make better your website speed. Just increase our talking to setting a 404 error page in WordPress through the .htaccess file. Just read here how to access a .htaccess file or how to create access file?
Set 404 Error Page in .htaccess File
Just follow some easy steps to set 404 error page in the .htaccess file.
- Now just edit your .htaccess file.
- Enter the below line to set 404 message on 404 error not found the page.
ErrorDocument 404 "<H1>Page not found</H1>"
- If you have already created 404 error not found custom page then you can call this page by typing below code.
ErrorDocument 404 /404.html
- After that just save this and you will get a message.
- Now when you get that page which is not available on your website then you will get a 404 error not found a page like shown below.
Keep in mind don’t forget to fix the error of 404 error not found page regularly because 404 error not found pages effect on your website ranking. Try to create 404 error not found pages redirect regularly you can get 404 error not found pages report from Google Webmaster tools by a sign in your Google Webmaster tools. You will find the status of errors here like shown below.
If you face any difficulty you can leave a comment in comment section.