Set 404 Error Page Through .htaccess File?

Set 404 Error Page Through .htaccess File

Now we will discuss how to set 404 error page through .htaccess file. Today I will tell you how to set 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.

Page not found

Page not found 1

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.

Crawl Error Google Console

Google Console

Lastly, you have read how to set 404 error page through .htaccess file. Don’t forget to follow us on Twitter. If you face any difficulty you can leave a comment in comment section.

Tagged With
Show More

Global Blurb Team

"Global Blurb since 2015" Global Blurb providing information about SEO, Beauty, Health & Fitness, Interior designing, Fashion and ways of earning online without investing a penny. The blog designed to share ideas about different topics.

Want to contribute

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button