Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "page trying to load scripts from unauthenticated source" [closed]

How can I fix this in my PHP page that contains ad scripts?

I have added scripts. It worked fine in HTTP but after I switched my site to HTTPS, nothing is appearing.

This is the error in dev console:

Failed to load resource: the server responded with a status of 404 (Not Found) index.php:1

Mixed Content: The page at 'https://myrevenuebank.com/index.php' was loaded over HTTPS, but requested an insecure script 'http://resources.infolinks.com/js/infolinks_main.js'. This request has been blocked; the content must be served over HTTPS.

<script type="text/javascript">
  var infolinks_pid = 2735394;
  var infolinks_wsid = 0;
</script>
<script type="text/javascript" src="http://resources.infolinks.com/js/infolinks_main.js"></script>
like image 267
isubhamb Avatar asked Apr 27 '16 19:04

isubhamb


2 Answers

click View > Developer > JavaScript Console. Send us what errors you have in developer Console. try to use https rather than http in script link. also you can try to download the script and put it in your server.

  1. you have 404 on menu.css (missing file)
  2. you are loading http script from https website. change http://resources.infolinks.com/js/infolinks_main.js to https://resources.infolinks.com/js/infolinks_main.js
like image 173
FrontMonkey Avatar answered Nov 04 '22 21:11

FrontMonkey


The reason is because browsers will block insecure content when accessing a secure page unless the user specifically allows that content.

You are trying to access http://resources.infolinks.com/js/infolinks_main.js from a secure connection, but that will not work. Instead change the URL to //resources.infolinks.com/js/infolinks_main.js without the protocol.

Note: This will only work for things that can be accessed using exactly the same URL with both http and https, which is the case here. If the script is only available over http, you will not be able to access it via https and you would have to save it on your server instead of loading it from a remote server.

like image 4
Mike Avatar answered Nov 04 '22 21:11

Mike