tags:

views:

92

answers:

1
+2  Q: 

CSS for https urls

Hello,

looking for some help with images referenced within the stylesheet. I have no problems with these from non secure locations within the site but only from https. The stylesheet loads fine and displays everything correctly except for the images.

example:

body {
margin: 0;
padding: 0;
background: url(/img/background_tile.gif) top left repeat-x;
text-align: center;
background-color: #fff;
}

All my css files and other image paths inside the code use relative urls to images. How can I make sure they all work fine without hard coding my image paths with https or http? I want the code to work fine with http and https.

Thanks

A: 

I would open FireBug, look at the Net Tab, and see the HTTP status code for the image.

If the codes are 404, then I would look into the httpd.conf file (assuming you are using Apache) to see what the DocumentRoot is for your port 443 directives.

I say this knowing that is only kind of makes sense because if the 443 directive had a completely incorrect DocumentRoot then the entire site would not display. FireBug Example

Christopher Altman