Op-edFixing HTTPS Mixed Contents with Google AdSense CSE Search

Fixing HTTPS Mixed Contents with Google AdSense CSE Search

Many bloggers may not able to afford the SSL Certificate or the hosting service provider that support and offer SSL over shared hosting or the VPS. Well, for them CloudFlare is there which is one of the largest Content Delivery Network (CND) with more than millions of websites. The Cloudflare offers free SSL certificate which you can enable even if your current hosting provider doesn’t support or allow SSL.

Those who have already moved to HTTPS are having problem with Mixed Contents which means that the some of the contents of the page is still using the HTTP where the entire page is loading over HTTPS. This could bring a very bad impact on your users and the visitors with the shocking warnings for stealing information by their web browsers.

These changes are in your hand and you can simply edit and can change the HTTP to HTTPS, but in case of Google AdSense Custom Search Engine (CSE) which help us to make some more dollars may stuck over HTTPS and give a blank page and this is just because Google AdSense CSE is still using the HTTP protocol to load the content in an iframe. Even if you will change the HTTP to HTTPS in the URL which is loading the show_afs_search.js is not going to help you at all as the content is being severed by Google and is control by Google itself and there is problem or you can say a bug with the Google show_afs_search.js script.

The only solution to fix the problem with Google AdSense CSE Mixed Content Search is:

  • Download the show_afs_search.js from google.com/afsonline/show_afs_search.js
  • Change the c=”http://”+c+”?”; to c=”https://”+c+”?”; in show_afs_search.js
  • Save the show_afs_search.s anywhere on your website (let’s say is accessible from your_website.com/show_afs_search.js)
  • Change the source path in the Google Search code to yours customized show_afs_search.js
  • Save the your page and enjoy!

Thank you! For reading!

Isrg Team
Isrg Team
Isrg Team is a member of Digital Pradesh News Networks, a collective of journalists, reporters, writers, editors, lawyers, advocates, professors, and scholars affiliated with the Digital Pradesh News Network.

Latest Updates