Quote:
when a webpage changes from http protocol to https (SSL), if you embed any images by absolute paths without domain names (/images/o.jpg), they will be broken.
If you embed images with full URL absolute paths (http://yourdomain.com/images/o.jpg), the images will show up, but the user will get warning messages that the page is a mix between secure and non-secure items.
On web pages that make transitions between http and https, one should use relative paths to avoid these problems.
|
Source:
Absolute and Relative File Paths
An absolute URL would be:
Code:
<img src="http://www.yoursite.co.uk/images/mygif.gif">
A relative URL is one that is relative to file path of the document that calls it. For files located in the root of your web, you could call an image using:
Code:
<img src="/images/mygif.gif">
Likewise, using relative file paths for documents in a subfolder (one level deep), you'd call an image using:
Code:
<img src="../images/mygif.gif">
For images in documents two levels deep (within a sub-subfolder) you'd use:
Code:
<img src="../../images/mygif.gif">
TIP:
Because I wanted my site to be able to bounce back and forth between protocols, I got around the missing images and security alert box by specifying absolute URLs without the http:// or https://. The browser automatically appends the correct protocol as required. It's not exactly valid code but works like a charm, just as if you were to type in your site URL without typing the protocol. If you're stuck, give this a shot.
For example:
Code:
<img src="www.mysite.com/images/header/mylogo.gif">