Recent Posts

Best Blogger | Tech Tutorials
Subscribe Via Rss Subscribe To The Latest Tips & Tricks
Follow On Twitter Follow @naijaclub10_com On Twitter
Receive The Latest Posts Directly To Your Email - It's Free: Email rss Enter Your Email And Click Subscribe
What is rssHave You Subscribed ?

September 15, 2013

Automatically Redirect Blogger 404 Error Page to Homepage?

What is 404 Error Page? According to Wikipedia, "The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested."
In simple English, basically if you try to visit a page on your website that doesn't exist you will end up with some type of 404 error page.
For example on tech-hacks.com, I had a page

http://www.naijaclub10.com/2013/09/will-be-talking-about-wrinkles.html and if you try to visit it, it will show you a blogger 404 page not found message.

That page or any page that doesn't exist, could be redirected to home page, or any other page that you like on your website.
Blogger now offers a custom 404 error page settings. 404 error page setting options are available under Your Blog --> Settings --> Search preferences. Under search preferences you will see something called Errors and redirections, where you can define the message you want to display on your error. 


Now here is the meat of the post that you are looking for.
I am going to teach you how to redirect your 404 error page to your home page of any other page. Follow the below Tech-Hacks.Com instructions to redirecting your custom error page to Home Page.
1. Go to Blogger--> Template --> Edit HTML --> Proceed (Please make sure you have backed up your blog).
2. Look for "</head>"
3. Below the above found code you have to paste the following code

<b:if cond='data:blog.pageType == "error_page"'>
&lt;script language=&quot;javascript&quot;&gt;
window.location=&#39;<data:blog.homepageUrl/>&#39;;
&lt;/script&gt;
</b:if>
3. Done! That's it, now your 404 error pages will redirect to your homepage.


If you want to redirect it to a different page you can change "<data:blog.homepageUrl/>" from the step three to whatever url you want to redirect it to. Enjoy one another hack.

No comments:

Post a Comment