Coding for https

when you look at this site in Internet Explorer, you’ll notice that some of the pictures are missing. But if you look at it at the unsecure location (http:// instead of https://) you’ll notice the pictures are there. Why is that and how do i fix?

please advise. thanks in advance!

IE has a built in fail safe that detects an SSL connection but stops any unencrypted content from entering the page without manual input from the user to override the browser, what you will need to do is ensure all <link>, <script> and <img> elements use HTTPS or you will continue to run into issues as currently your page is only partially encrypted.

Another solution might be not to use the full URL in your image links. E.g. Instead of links like this:

src="[COLOR="#FF0000"]http://www.emazzanti.net[/COLOR]/wp-content/uploads/digital-disaster-featured.png"

use something like this

src="/wp-content/uploads/digital-disaster-featured.png"

Another, similar option would be to use a protocol-less URL (handy for when you do need the domain, and can’t use root relative URLs)

e.g. including external scripts

<script type="text/javascipt" src="[COLOR=#ff0000]//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js[/COLOR]"></script>

e.g. including things on your own server that might be served on a different domain:

<script type="text/javascipt" src="[COLOR=#ff0000]//cdn.example.com/scripts/example.js[/COLOR]"></script>

If however, everything you’re referencing is on the one domain, go with Ralph.m’s solution, root relative URLs :slight_smile:

I understand using the relative paths is the best way to go, but is there a way to do it if you have some pages that are several layers deep and you are using the full paths?

I also have links to other sites, does that trip the error message?

Sorry to sound so dumb, but while I can find lots of information on purchasing and installing SSL, I can find very little about the actual page coding. I have changed all the links within my website (that point to my website) to https but I still get the error message.

Anybody know of a good book? Thanks so much for your help, Kathy

You should be able to use root-relative URLs (like in Ralph’s example). They will work no matter how deep your page is nested.

The actual links themselves won’t throw an error message as they aren’t resources being loaded in to your page

On whichever page you’re seeing that message, take a look in the source code and see if anything is being referenced with http://

Thanks guys, I’ll give it a try. The reason I was trying to get around using relative links with a lot of …/…/…/ is that I have several people who with very basic code skills are able to edit their own content and they understand the links better that way. Guess a new class is in order if they want to use the https.

I appreciate your time and expertise and will let you know how it goes :wink: Kathy

PS, I got more information here that I have all day looking through books and other websites, the Sitepoint facebook page sent me here.

Whether you’re using relative links like you’re showing here or root relative links, there should be no problem as neither of them specify the protocol used (and thus they will use the protocol that is currently in use).

It might be worth teaching people about root relative links though as that can often be a much better way to go than having “…/…/…/…/…/…/…/images/whatever.jpg”

wish me luck, I work with math, science and biology teachers who are geniuses in their areas but it’s a slow go getting them out of their comfort zones…lol