Senin, 26 Januari 2015

How To Redirect 404 Error (Page Not Found) To Homepage In Blogger

how to redirect 404 error (page not found) to homepage in blogger
  
Today, I come with a very important tutorial is 404 page redirection, 404 error page tells user and search engines that a “page is not found". If anyone trying to access the page and suddenly appear “Page Not Found - 404” error. why does it occur? it's happens because you may have deleted your blog post or changed URLs. So in today’s tutorial I will tell you how to add/setup generic and custom blogger 404 redirection page in blogger.

Also Read: How To Add Custom Robots.txt File In Blogger/Blogspot

If you have deleted any blog post or changed blog post URLs and this time you have not setup 404 error page redirection in blogger then you will find your all 404 error pages in webmaster tools crawl section. 

You can redirect your blog visitors automatically to homepage within few seconds using blogger 404 page redirection, So let start the tutorial.

 

Redirect 404 Error Page using JavaScript in Blogger :

 

Step 1
Go to blogger dashboard >> Search "preferences” option under the “Settings” tab.

Step 2
Now click on custom page not found >> Edit option under the "Errors and redirections"

how to redirect 404 error (page not found) to homepage in blogger
Step 3
Copy the below code and paste in text box and click Save Changes.

Redirection JavaScript
<h1>Page Not Found!</h1>
<br><b>We're sorry but we could not find the page you are looking for.
This may happen if you have entered site URL incorrectly or this page doesn't exist anymore.</b>
<script type = "text/javascript">
BSPNF_redirect = setTimeout(function() {
location.pathname= "/"
}, 5000);
</script>
how to redirect 404 error (page not found) to homepage in blogger

 

Setup Custom 404 Error Page in Blogger :

 


Step 1
Go to blogger dashboard and create a new page with title Page not found!.

custom 404 error (page not found) page in blogger

Step 2
Now click on custom page not found >> Edit option under the "Errors and redirections"

custom 404 error (page not found) page in blogger

Step 3
Copy below redirection JavaScript and replace "/p/page-url.htm" with your page name and paste in text box and click Save Changes. .
<script type = "text/javascript">
setTimeout(function()
{
location.pathname= "/p/404-page.html "
},
5000);
</script>

custom 404 error (page not found) page in blogger

Final Words !


This was the today’s tutorial on how to redirect 404 error (page not found) to homepage in blogger and how to setup custom 404 error page in blogger.

If you have any quires regarding this tutorial then please feel free to ask with comment below this post.. And if you think my post was worth reading, then please don't forget to share it with your social media friends. Happy Blogging !

Tidak ada komentar:

Posting Komentar