Skip to main content

How to automatically redirect the blogger 404 error page to search page based on the keywords in failed url?



Blogger allows user to show a customised 404 (page not found) error page. You can add contents for your 404 error page through your blogger admin.

Do the following steps:

Login to Your blogger account

Select your blog

Click on "Settings" on the left side menu

Click on "Search Preferences" ( Settings >> Search Preferences )



Go to the "Errors and redirections " section
- Here on the given textarea you can add the contents for your customised Page not found page.
- The text area accepts a maximum of 10,000 Characters.
- You can add html code in this text area.

Let us do a trick to redirect the 404 Error page to a search page which lists records that matches the keywords found on the failed url. Here a javascript function which gets the urls page identifier and redirects the page to the search page by appending the keywords to the search url.

Copy the below given script, paste it to the "Errors and redirections >> Custom Page Not Found" text area and Save it.




<br><br>
<b style="font-size:15px;color:#000000">Page Not Found!</b><br>Sorry, the page you requested is not currently available. Please use the <b>SEARCH</b> option of website.
<br><br>
<a href="http://techqube.blogspot.com"><b style="color:red">VISIT HOME PAGE</b></a>
<br><br>
<script>
function getpageUrl()
{

var pagelink="";
var myurl=document.URL;
myurl=myurl.replace("http://","");
myurl=myurl.replace("https://","");
var st_n = myurl.lastIndexOf("/");
myurl=myurl.replace(".html","");
myurl=myurl.replace(".","");

if( st_n > -1 ){
var firstcharloc=st_n+1;
var lastcharloc=firstcharloc+200;
pagelink= myurl.slice(st_n,lastcharloc);
}

if(pagelink!=""){
pagelink=pagelink.replace("/ /g","%2B");

pagelink = pagelink.replace(/-/gi,' ');
pagelink = pagelink.replace(/_/gi,' ');
document.location.href="http://www.techqube.blogspot.com/search?q="+pagelink+"&search=Search&max-results=20&by-date=false";
}

}

getpageUrl();
</script>

Please don't forget to replace "techqube.blogspot.com" with your blog address :)


Related posts:
  1. How to redirect old blogger blog links to a new web address with out affecting the search traffic? 
  2. How to create a blogger landing page which will redirect to other pages based on the query string? 
  3. How to add Facebook Like button in Blog? 
  4. How to add Google PlusOne (g +1) Button on blogger pages?  
  5. How to add BlogIt button or Widget on your blogger website 
  6. How to escape HTML scripts and JS codes for placing in blogger templates  
  7. Redirecting the blogger 404 error page to search page results?   
  8. Articles on Blogger tools, features and tips

Popular posts from this blog

How to apply for a new ration card and what are the documents required?

List of documents required for new ration card application in Kerala and how to apply


Application for a new ration card should be addressed to Taluk Supply Officer (TSO) / City Rationing Officer (CRO) of applicant's residing area.

Primary document required are Residence certificate, Income certificate and incase the applicant's name is in another ration card then he/she should submit the reduction certificate ontained from previous TSO / CRO as proof for removing his/her name from old Ration card.

You can get the new application from your currently residing Taluk Supply Office.

Payback Points - How to redeem - How to merge multiple payback accounts - Block Payback card - Payback customer care

Joomla and Forum Integration - Integrating Forums to Joomla

Joomla is one of the most popular CMS opensource packages. It is very easier to develop website's using Joomla. You just need to download Joomla package from Joomla's Official website www.joomla.org  and install it on your domain and later adding customizations to templates and feature and Your website is ready :). Now a days most websites provides a forum section for it users for discussing various article topics, gathering opinions etc.



Following are some best know forum opensource packages which can be integrated with Joomla and create a new forum experience for users


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog