Skip to main content

How to Force either HTTP or HTTPS on a Blogger Blog!


Recently, wait, actually, since the beginning of this blog, there has been one thing continuously bugging me related to one of the settings that blogger offers. Well, in the real beginning, there was an option for us to redirect our viewers to the HTTPS version only or the HTTP version only, but now that option HAS CHANGED! 

Now what is available is that we can only either force people onto the HTTPS version of our blog or let them stay wherever they are whether it is the HTTP or HTTPS. So a partial amount of freedom has been taken away from us... to many people, it even feels like blogger doesn't care about us... well, no need to fuss any longer.

A few days ago, I was going through my blog and was frustrated because some people were saying they were unable to view some JS content, but I knew that the reason was that they were viewing it all over the HTTPS server.

Now, to change that, I sought for help, but unfortunately, people had only written posts and tutorials of how they could force HTTPS and that too through the way blogger allows it to happen. But, luckily, I have found the solution!

So, without further ado, let's find out how to force either HTTPS or even HTTP servers on your Blogspot blog so that you can either 'forcefully' provide people an encrypted connection, or allow 100% of your viewers to be able to view all of you JS and other scripts at all times!

1. How to Force HTTPS

1. a) With Scripts

Though this is not the common way you would do this, you still can use a little code in your template to force people to view your site over an HTTPS server.

Steps - 

1. Open your Blogger Dashboard > Theme > (You might want to save a backup of your blog) > HTML editor.


2. Locate -

<header>

3. Now copy the script provided to you and paste it under the <header> tag -

<script>
if (window.location.protocol == "http:") {
console.log("You are not connected with a secure connection.")
console.log("Reloading the page to a Secure Connection...")
window.location = document.URL.replace("http://", "https://");
}
if (window.location.protocol == "https:") {
console.log("You are connected with a secure connection.")
}
</script>


4. Save the template.

1. b) The Blogger Way

This is the method which Blogger intends for you to use and it is actually much easier too! -

1. Open your Blogger Dashboard > Settings > Basic.

2. You will have to scroll down the page a little and you will see a drop-down box, click it and make sure that you have selected Yes.



3. Save your changes


2. How to Force HTTPThere isn't any way to force HTTP, or at least not a way that has been provided by blogger! To be able to easily force HTTP, you just have to follow these steps.


1. Open your Blogger Dashboard > Theme > (You might want to save a backup of your blog) > HTML editor.



2. Locate -

<header>

3. Now copy the script provided to you and paste it under the <header> tag -

<script>
if (window.location.protocol == "https:") {
console.log("You are not connected with the correct protocol.")
console.log("Reloading the page to the correct protocol...")
window.location = document.URL.replace("https://", "http://");
}
if (window.location.protocol == "http:") {
console.log("You are connected with the correct protocol.")
}
</script>

4. Save the template.

3. How to Force Neither

If you are okay with your viewers viewing their preferred version of your site, then you also have an option to leave it up to them. Here is how -

1. Open your Blogger Dashboard > Settings > Basic.



2. You will have to scroll down the page a little and you will see a drop-down box, click it and make sure that you have selected No.



3. Save your changes.

I hope that this little tutorial was easy enough and also did what you wanted it to do! If you have any doubts about anything, then feel free to ask and also share your experience! Stay Tuned!

Comments

Popular posts from this blog

How to Remove the Designed/Created by Copyright Mark From A Free Blogger Template

Whenever we write a new blog, we get set with default blogger templates which are quite unattractive. Even though Blogger.com has updated its list of default templates for us to choose from, many of us prefer to use our own templates or those provided by free and paid template giving sites.  Some people think that the paid templates given are either too expensive, do not find it necessary to buy them, or prefer the free copyrighted versions. But personally, whatever reason we might have not to buy a paid blogger template, we all have that little desire to remove that thing we didn't pay to remove.  So, today I will show you guys how to remove copyright marks, and then I am sure that you will be able to call your template completely yours. The Main Issue Leading template distributor sites like   T emplateify , T emplateism , Goyabi, etc. distribute templates with both free and paid versions. If we buy the paid templates we get many features like support,...

Marketing Myths That Are Killing This Generation Of Businesses - The Right Approach to Grow Your Business

You can make blogs. You can tweet or post updates on social media regularly. You can post daily podcasts. You get even create a profile on LinkedIn. You can create endless YouTube videos.  You can build an influential presence on Instagram and Snapchat and Pinterest. Then, fingers crossed, you hope that you build your own tribe of people that love you.  Then you hope that your readers, followers, or subscribers, buy from you. It's called content-first marketing , and it rarely works. Sure, you may get tons of likes and reshares and may be useful to get loads of attention, but if it doesn't help you build a business, it isn't worth it. There's a better way. People have built multimillion-dollar companies with one or two pieces of content. Here is the key. Instead of using the "content-first marketing" approach, you need to obsessively focus on a "problem-first" approach .  Russ Ruffino, founder of Clients on Demand said "For months in 2013, all ...

Top 10 Common Mistakes Every Blogger Makes + Infographic

Heya! Today, I was going through Pinterest , and I saw a pin which led me to some questions on Quora  (BTW, check out my profiles too! 😉) on which people were giving links in their questions and asking people what they thought was wrong about it because they weren't able to get visitors. I took a look at all of them, mine, and the blogs and websites of other successful people. There were many major differences, many that even I overlooked. I have fixed up my blog and today, I am writing this post so that you can do the same! Take a look at this very special infographic I prepared for all of you. You can read it and understand the basic purpose of this post or you can also continue ahead after reading the infographic to understand every point better with extensive detail. First of all, how did you feel about my infographic? Do you think that you can relate? No need to feel ashamed, these are some problems and mistakes that most bloggers commonly face when it comes to ...