[ic] Re: css background command

ic at 3edge.com ic at 3edge.com
Fri Aug 12 05:16:27 EDT 2005

John Wolgamot writes: 

> I also understand (from trial in error) that absolute URLs to images within
> interchange will result in secure pages complaining about the nonsecure
> images.  Eg. In the fly page, the standard abbreviated interchange URL is:
> <IMG SRC="items/[item-field image]" this works on secure and nonsecure
> pages. 
> but if I were to use an absolute URL like
> <IMG SRC="http://www.testsite.com/items/[item-field image]"
> this would result in a question asking the user if they want to display the
> nonsecure items on the secure page. 

<IMG SRC="items/[item-field image]"   will append the 
'http(s)://www.testsite.com' part in front of 'items' to reflect the server 
you are currently on. If it's SSL then it's https - if nonSSL - http. 

So if you are on https://www.testsite.com/  and then use absolute URL 
http://www.testsite.com/ it will give the display question. So if you are 
switching between HTTP/HTTPS on your website then the absolute URL for 
images is not advisable I'd say. 

> When I use the background command in the css file as the example below
> illustrates, it works fine when you access the catalog with the normal URL
> like:
> http://www.testsite.com/cgi-bin/testsite/index.html 
> The background image defined the CSS file does not show up on a secure page
> whereas all the product images and other catalog template images display
> just fine weather in secure mode or nonsecure mode. 
> Here's a snippet of the CSS file with the background command. 
> <STYLE TYPE="text/css"> 
> BODY {
>   background-color: #E0D2A1;
>   font-family: Verdana;
>   font-size: 10px;
>   margin-left: 0px;
>   margin-right: 0px;
>   margin-top: 0px;
>   margin-bottom: 0px;
>   background-image: url(blueyellow/catbar2.jpg);
> } 
> Also, when I changed the httpd.conf file to show the catalog from the main
> URL by commenting out the standard directory index and adding the one shown
> below... DirectoryIndex cgi-bin/testsite/
> After this change I no longer see the background image which is defined in
> the CSS file from the start page www.testsite.com 
> With the altered httpd.conf The background displays just fine for all other
> aspects of the site except on secure pages and the start page
> www.testsite.com 
> Here is the Apache config example with the original directory index
> commented out and the new one defined just below the original directory
> index. 
> <VirtualHost>
> ServerName www.testsite.com
> 	ServerSignature email
> DocumentRoot /home/testsite-site
> #	DirectoryIndex index.html index.htm index.php index.shtml
> 	DirectoryIndex cgi-bin/testsite/
> 	ServerSignature email
> 	LogLevel warn
> 	HostNameLookups off
> </VirtualHost> 
> If I change the css file to reflect the entire url to the image 
> background-image: url(http://www.testsite.com/blueyellow/catbar2.jpg 
> then it displays but when you go to a secure page it gives you a warning
> asking if you want to display the non secure items on the secure page. If
> you select no, then the background image defined in the CSS file does not
> display.  If you click yes then of course it does display. 
> It appears when I change the directory index, somehow interchange doesn't
> know about the abbreviated URL.  Even if this is the case it still doesn't
> explain why the background image won't work on secure pages but works fine
> on nonsecure pages. 
> I hope this is enough info. 
> Please go easy on me. Although I've come a long way I still have a hard time
> understanding the cryptic talk the experienced interchange developers seem
> to naturally understand :-) 

I don't think you need to be changing the DirectoryIndex. Don't think what 
is happening is related to that. 

The above shown DocumentRoot  /home/testsite-site  is the document root for 
your SSL aswell as your nonSSL site? I suppose you are having configuration 
settings for both instances? 

I would suggest that you check the DocumentRoot for both SSL and nonSSL 
apache configs and set the DocumentRoot the same for both. Then remove the 
absolute URL's for the images (so no http/https://.....) and see if that 
solves your problem. Good luck. 

> Thanks,
> Wolga 
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users

More information about the interchange-users mailing list