How To Redirect Your Blog From HTTP To HTTPS?
We will do this using an easy-to-understand chunk of JavaScript. This piece of JavaScript can quickly redirect your blogger blog if it is being browsed using blog's HTTP URL.
Note: - Doing the steps mentioned below, you are also preventing your blog from being penalized by Google Panda penalty.
Steps:
- Visit Blogger > Template > Edit HTML
- Use Ctrl F, search for "<head>" in your template.
- Paste the following chunk of code below it, :
- Change the highlighted words with your blog's URL. (Don't change HTTPS:// before the URL)
- Save your template and you are done!
<link href='https://YOUR BLOG ADDRESS HERE' rel='canonical'/><script type='text/javascript'>
function check_secure() {
var secssl = /^https/i;
var blog = document.location.hostname;
var slug = document.location.pathname;
var subs = window.location.search;
if (!window.location.origin.match(secssl)) {
window.location = "https://" + blog + slug + subs;
}
}
check_secure();
</script>
Note :- The bolded code will make your blog free from being sactioned by Google according to its algorithm, Panda. The URL in the bolded code will aid Google see to it that what is the main URL of your blog and where to pass the link juice.
<b:include data='blog' name='all-head-content'/>Please Let us Know the out come drop your comments...Here!!!