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

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

Your SBI Debit card ending with XX0000 is deactivated only for Internet txn.

SBI account holders may have received an SMS with following message, supposed to be from State Bank of India (SBI).

Your SBI Debit card ending with XX0000  is deactivated only for Internet txn. To activate send SMS "SWON ECOM 0000" to 09223966666. No change for ATM/POS usage
** Replace the four Zeros with last 4 digits of your debit card number

Recently many of the SBI account holder has losed their money due to a hi-tech ATM robbery which happened in Thiruvananthapuram, capital city of Kerala.

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