WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2008, 01:46 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Question images not displaying on SSL pages

My problem is:

Whenever you go to a https webpage on our website the images dont load up even through they have the correct https:// path.

We have a dedicated SSL.

If I store the images on our shared SSL they load up fine in the https webpages.

The images load up fine on their own in a IE7 browser in https.

The images load up fine on a regular http url.

We do not have a dedicated IP.

Any idea what the problem is?

Thanks for any help with this!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 01:55 PM
activeco activeco is offline
WebProWorld Veteran
 

Join Date: Jul 2004
Posts: 850
activeco RepRank 1
Default Re: images not displaying on SSL pages

Difficult to find out without the url.
__________________
Vote Hussein, vote humanity
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 02:01 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

I have sent you a private message with a url. Thanks
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 02:48 PM
Dubbya's Avatar
Dubbya Dubbya is offline
WebProWorld 1,000+ Club
 

Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,098
Dubbya RepRank 3Dubbya RepRank 3
Default Re: images not displaying on SSL pages

use relative urls... not defining them as http:// or https:// also prevents the insecure content warnings.
__________________
Printer ink, inkjet & toner cartridges in Canada
"Price-wise printing supplies"
inkjetOasis.ca
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 03:01 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

I dont know what a relative url is

I have just found that this works:-

Image load up on my ssl webpage with https://mywebsite.com/image/image.gif but not with https://www.mywebsite.com/image/image.gif

Why would it work like that?
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 03:27 PM
activeco activeco is offline
WebProWorld Veteran
 

Join Date: Jul 2004
Posts: 850
activeco RepRank 1
Default Re: images not displaying on SSL pages

Check files/dir permissions. The images return 403 code.
Also a few javascript files were not found (builder.js, exxects.js, dragdrop.js...).
__________________
Vote Hussein, vote humanity
Reply With Quote
  #7 (permalink)  
Old 02-27-2008, 03:31 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

the title.gif has a chmod of 644

I dont think builder.js, exxects.js, dragdrop.js are used.
Reply With Quote
  #8 (permalink)  
Old 02-27-2008, 03:32 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

the image folder is chmod 755
Reply With Quote
  #9 (permalink)  
Old 02-27-2008, 04:07 PM
Dubbya's Avatar
Dubbya Dubbya is offline
WebProWorld 1,000+ Club
 

Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,098
Dubbya RepRank 3Dubbya RepRank 3
Default Re: images not displaying on SSL pages

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">
__________________
Printer ink, inkjet & toner cartridges in Canada
"Price-wise printing supplies"
inkjetOasis.ca
Reply With Quote
  #10 (permalink)  
Old 02-27-2008, 05:15 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

that coded looks like <img src="www.mysite.com/www.mysite.com/images/header/mylogo.gif"> in the browser.
Reply With Quote
  #11 (permalink)  
Old 02-27-2008, 05:18 PM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

The only way i have been able to get images to load in the ssl is to use https://mywebsite.com/image/image.gif

/images/image.gif and https://www.mysite.com/images/image.gif doesnt work, although if you right click the image, the url is fine.
Reply With Quote
  #12 (permalink)  
Old 02-27-2008, 07:55 PM
activeco activeco is offline
WebProWorld Veteran
 

Join Date: Jul 2004
Posts: 850
activeco RepRank 1
Default Re: images not displaying on SSL pages

Look at the log file and find the '403' messages. You can post it here if you wish.
It looks like php script or some other file doesn't have access to directories.
Do you have installed subversion or do you use Yoomla or something similar which could have installation problems?

Also check if you get the same errors with a user logged-in.
__________________
Vote Hussein, vote humanity

Last edited by activeco : 02-27-2008 at 08:09 PM.
Reply With Quote
  #13 (permalink)  
Old 02-28-2008, 10:03 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,629
wige RepRank 4wige RepRank 4wige RepRank 4
Default Re: images not displaying on SSL pages

Quote:
Originally Posted by Britishcandycom View Post
I dont know what a relative url is

I have just found that this works:-

Image load up on my ssl webpage with https://mywebsite.com/image/image.gif but not with https://www.mywebsite.com/image/image.gif

Why would it work like that?
Your security certificate is based on your subdomain name. It will either be issued to www.domain.com or domain.com. Whichever version you have on the certificate is the one that will work in your URLs, and the other form can not be used.

Quote:
Originally Posted by Dubbya View Post
For example:
Code:
<img src="www.mysite.com/images/header/mylogo.gif">
This URL format is not widely supported. Although web browers are able to figure out that it is a URL in most cases, search engine spiders CAN NOT. In addition, browsers may default to the wrong protocol. There is a fully supported option that allows you to omit the protocol specification. This format tells the browser or spider to use the same protocol as the current document.
Code:
<img src="//www.mysite.com/images/header/mylogo.gif">
__________________
The best way to learn anything, is to question everything.
Interestingly Average Security Blog
Reply With Quote
  #14 (permalink)  
Old 02-28-2008, 11:30 AM
Britishcandycom Britishcandycom is offline
WebProWorld New Member
 

Join Date: Jan 2004
Location: United Kingdom
Posts: 14
Britishcandycom RepRank 0
Default Re: images not displaying on SSL pages

The cert is issued to www.mysite.com

secure images will not load up on secure pages on my website.
Reply With Quote
  #15 (permalink)  
Old 02-28-2008, 11:38 AM
activeco activeco is offline
WebProWorld Veteran
 

Join Date: Jul 2004
Posts: 850
activeco RepRank 1
Default Re: images not displaying on SSL pages

I don't think it is an ssl problem. Once the mismatch warning is accepted everything should load OK.
BritishCandy, do you have images hotlinking protection? Something like "RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/noimage.jpg" ?
__________________
Vote Hussein, vote humanity

Last edited by activeco : 02-28-2008 at 11:40 AM.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: images, ssl



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LIVE bot looking for my pages in the images folder(?) memaggiem MSN Search Discussion Forum 7 12-18-2007 09:19 AM
Displaying images jazzmatazz2005 Database Discussion Forum 4 09-14-2006 08:32 PM
Google Cache Not Displaying Product Images? cz Google Discussion Forum 2 02-05-2006 01:24 AM
Google Testing Images On Web Results Pages WPW_Feedbot Search Engine Optimization Forum 0 01-05-2005 06:30 PM
Images not displaying SmartBiz Web Programming Discussion Forum 6 11-04-2003 04:19 PM


Search Engine Friendly URLs by vBSEO 3.0.0