Wednesday, 5 December 2018

How to automatically redirect Blogger blog to another blog or website

A few posts back we made any article about Blogger custom redirects in which you can redirect within your blog. That is you can redirect your specific post URL to another post or page, all 301 or 302 redirection within your blog. That will be useful for redirecting 404 error pages and broken links; however with that you cannot redirect homepage to any particular URL. Here we will show you how to automatically redirect Blogger blog to another blog or website or any URL. So with this technique you can redirect your Blogger Homepage or any particular page to external websites.
Let’s say you want to redirect your complete Blogger blog to another page or URL. That is redirecting your homepage, posts page, archives page and all other URL in your blog to another specified external website. You have to use this if you just moved to new domain. To do this you are going to make changes to your template file. So before you mess up with the codes it’s recommended that you backup your template first.
  1. Login to your Blogger dashboard
  2. Go to template and click edit HTML
  3. Now you can see template codes. Press CTRL + f and then find <head>
Now add the following code below head tags.
<script type='text/javascript'>
  var d='<data:blog.url/>';
  d=d.replace(/.*\/\/[^\/]*/, '');
  location.href = '';
In the above code change which is the destination URL. Now all your pages from the blog will be redirected to destination URL.
Now we will see another piece of code that redirects particular blog URL to another blog or website. If you wish not to redirect the whole blog then you have to make use of this code. Also you can use this for redirecting user from a particular page to another external website for promotional purpose.
To do this just paste the following code below head tag and change the from URL that is and destination URL that is
if(window.location.href == ' ')
The above code just redirects user from the specified BlogSpot URL to another website or URL.

Hope this article guided you on how to automatically redirect Blogger blog to another blog / website or URL. Share this and if you found it useful then please leave your comments.