Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SSL works on some pages but not all


Guest

Recommended Posts

Posted

This URL is hosted through Resilient Hostings.com which keeps the SSL on the same server. My problem is I can not get the images to work properly. I have read through several of the threads and here is what I have tried.

 

In the includes/config.php and admin/config.php I added the following:

 

// define our webserver variables 
// FS = Filesystem (physical) 
// WS = Webserver (virtual) 
define('HTTP_SERVER', 'https://www.yourdomain.com'); // eg, [url="http://localhost"]http://localhost[/url] or - [url="https://localhost"]https://localhost[/url] should not be NULL for productive servers 
define('HTTPS_SERVER', 'https://www.yourdomain.com'); 
define('HTTP_CATALOG_SERVER', 'https://www.yourdomain.com'); 
define('HTTPS_CATALOG_SERVER', 'https://www.yourdomain.com'); 
define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module 
define('ENABLE_SSL', 'true'); // secure webserver for catalog 
define('DIR_FS_DOCUMENT_ROOT', 'https://www.yourdomain.com'); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) 

 

and everything works great until I click on the shopping cart button and the url changes to the following:

 

https://botanicalgardenproducts.com/shop/catalog//shop/catalog/shopping_cart.php

 

instead of being:

 

https://botanicalgardenproducts.com/shop/catalog/shopping_cart.php

 

It adds an additional //shop/catalog.

 

I have also tried:

 

  if ($request_type = 'SSL'){
 define('DIR_WS_IMAGES', 'https://my.secureserver.com/~user/pathto/mycatalog/images/');
 } else {
 define('DIR_WS_IMAGES', 'images/');
 }

 

and all that does is add the products images and not the background images.

 

Can anyone tell me what I am doing wrong or how to fix this.

Posted

osC isn't recognizing your SSL.

 

In your shop/catalog/includes/application_top.php find this code:

 

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

Replace that line with this code:

 

// $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
// modification added 05/14/08
$request_type = (getenv('SERVER_PORT') == '443') ? 'SSL' : 'NONSSL';

It would be a good idea to make a backup of any file before making any edits.

 

This usually works, but there is an outside chance we'll have to change it to something else.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
osC isn't recognizing your SSL.

 

In your shop/catalog/includes/application_top.php find this code:

 

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

Replace that line with this code:

 

// $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
// modification added 05/14/08
$request_type = (getenv('SERVER_PORT') == '443') ? 'SSL' : 'NONSSL';

It would be a good idea to make a backup of any file before making any edits.

 

This usually works, but there is an outside chance we'll have to change it to something else.

 

 

Thank you for getting back to me so quickly. I added it in and did not see any change from what I was doing before. It did not seem to be loading as a secure site (no https, just http) and when I changed it myself it looked ok but when I clicked a link it just reverted back to the http. I also added back in the first string of code that I mentioned above and the same problem is still happening.

 

In essence, I want the customer wants the whole site secure and I can not get it to work.

 

Any more ideas?

 

Clint

Posted

Ok, let me take a step back.

 

When I take everything out accept what you had me put in I can click on a link and it shows the page under a http url. I can now replace the http with https and the page loads properly. but when I click on a link again, it reverts back to http.

 

Any ideas?

 

 

Clint

Posted

Make the change I suggested and leave it that way.

 

It made a difference, although you couldn't see it.

 

When you have the change back in place that I suggested, post again.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
Make the change I suggested and leave it that way.

 

It made a difference, although you couldn't see it.

 

When you have the change back in place that I suggested, post again.

 

 

Thanks for the reply Jim. It was there. I never took it out.

 

 

Clint

Posted

Well, the first day when I posted, I thought you had made the change because once when I refreshed my browser the pics actually showed up on your site.

 

So, I assumed you changed it back because in successive refreshes the pics disappeared.

 

osC still isn't recognizing your SSL because of some setting on the server (I assume).

 

Let's try this:

 

Copy the text in the CODE box below into a text editor on your PC:

 

<?php
echo 'HTTP HOST: ' . "$HTTP_HOST";
echo '<br>Server Port: ' . getenv('SERVER_PORT');
echo '<br>SSL Status: ' . getenv('HTTPS');
echo '<br>Fowarded Server: ' . getenv('HTTP_X_FORWARDED_SERVER');
echo '<br>Fowarded Host: ' . getenv('HTTP_X_FORWARDED_HOST');
echo '<br>Fowarded By: ' . getenv('HTTP_X_FORWARDED_BY');
?>

Save it as myenv.php

 

Upload it into your /shop/catalog folder on your server.

 

Then, access it using this link:

 

Click Me

 

It will output some text to your browser.

 

Copy/paste that output into your next post.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Here it is:

 

HTTP HOST: www.botanicalgardenproducts.com

Server Port: 443

SSL Status: on

Fowarded Server:

Fowarded Host:

Fowarded By:

 

That is what I could get

 

Hope this helps.

 

Clint

 

p.s. Thank you for your continued help.

Posted

Now we have a mystery....

:blink:

 

This:

 

Server Port: 443

Should have worked with this code:

 

$request_type = (getenv('SERVER_PORT') == '443') ? 'SSL' : 'NONSSL';

And this:

 

SSL Status: on

Should have worked with this code:

 

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

Look in the <head> section of your /shop/catalog/index.php for a line that looks something like this:

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

Please post what code yours has for that line.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Here you go:

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

 

Hope this helps.

 

Clint

Posted

Dang...

:blink:

 

OK.

 

Now let's see the code from /shop/catalog/includes/application_top.php where it set's the variabale at.

 

Looks something like this:

 

// set the type of request (secure or not)
 $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

And what do you have for these in your /shop/includes/configure.php file:

 

  define('HTTP_SERVER', ''); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', ?); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', '');
 define('HTTPS_COOKIE_DOMAIN', '');
 define('HTTP_COOKIE_PATH', '');
 define('HTTPS_COOKIE_PATH', '');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

See below:

 

  define('HTTP_SERVER', 'http://botanicalgardenproducts.com'); // eg, [url="http://localhost"]http://localhost[/url] - should not be empty for productive servers
 define('HTTPS_SERVER', ''); // eg, [url="https://localhost"]https://localhost[/url] - should not be empty for productive servers
 define('ENABLE_SSL', false); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'botanicalgardenproducts.com');
 define('HTTPS_COOKIE_DOMAIN', '');
 define('HTTP_COOKIE_PATH', '/shop/catalog/');
 define('HTTPS_COOKIE_PATH', '');
 define('DIR_WS_HTTP_CATALOG', '/shop/catalog/');
 define('DIR_WS_HTTPS_CATALOG', '');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

Posted

That's the major malfunction!

:lol:

 

Try these in place of the ones you have for these lines:

 

  define('HTTPS_SERVER', 'https://botanicalgardenproducts.com'); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', '.botanicalgardenproducts.com');
 define('HTTPS_COOKIE_DOMAIN', '.botanicalgardenproducts.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Didn't work. It still looks all broken with no images.

 

Remember on my first post, I added:

 

// define our webserver variables 
// FS = Filesystem (physical) 
// WS = Webserver (virtual) define('HTTP_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); // eg, [url="http://localhost"]http://localhost[/url] or - [url="https://localhost"]https://localhost[/url] should not be NULL for productive servers 
define('HTTPS_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); 
define('HTTP_CATALOG_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); 
define('HTTPS_CATALOG_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); 
define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module define('ENABLE_SSL', 'true'); // secure webserver for catalog 
define('DIR_FS_DOCUMENT_ROOT', 'https://www.botanicalgardenproducts.com/shop/catalog/'); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs) 

 

to the configure.php and it worked, just when I went to click on the shopping cart it got all jumbled because it added an additional /shop/catalog into the url.

 

Thanks, Clint

Posted

ok, when I added a few things, the images all work but when I click a link, it forwards me back to a non-secured page. here is what I added:

 

  define('HTTP_CATALOG_SERVER', 'http://www.botanicalgardenproducts.com/shop/catalog/'); 
 define('HTTPS_CATALOG_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); 
 define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module   
 define('ENABLE_SSL', 'true'); // secure webserver for catalog 
 define('DIR_FS_DOCUMENT_ROOT', 'https://www.botanicalgardenproducts.com'); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)

 

I also replaced your:

 

  define('HTTPS_SERVER', 'https://botanicalgardenproducts.com'); // eg, [url="https://localhost"]https://localhost[/url] - should not be empty for productive servers

 

with:

 

  
define('HTTPS_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); // eg, [url="https://localhost"]https://localhost[/url] - should not be empty for productive servers

 

 

This gets us halfway there. Any ideas on where to go from here?

 

Clint

Posted

It worked, but you have another problem.

 

Change this in the /shop/includes/configure.php file:

 

  define('DIR_WS_HTTPS_CATALOG', '/shop/catalog/');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

when I do that the images go away again. I even tried placing the full url in it and it did the same thing.

 

I changed the

 

  define('HTTP_SERVER', '[b]http[/b]://botanicalgardenproducts.com'); // eg, [url="http://localhost"]http://localhost[/url] -
should not be empty for productive servers

 

to

 

  define('HTTP_SERVER', '[b]https[/b]://botanicalgardenproducts.com'); // eg, [url="http://localhost"]http://localhost[/url] -
should not be empty for productive servers

 

and it seems to keep it in the secured settings.

 

Now though everytime I click on a link, it tells me "There are secure and non secure items. Do you want to view the nonsecured items."

 

How do I get all items to be secured?

 

Clint

Posted

Dude, I can't hit a moving target.

 

Meaning...

 

If you want me to fix it, you've got to stop making changes on your own.

<_<

 

You're working against me here by making changes then I don't know what's what...

:blink:

 

If you want my help, post the contents of your /shop/include/configure.php file (LEAVE OUT THE DATABASE INFO AT THE BOTTOM!) then stop screwing with it unless I suggest a change.

 

Or, if you want to screw with it on your own, you don't need my help.

 

You decide.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Not trying to work against you, just showing you what works. My original issue is fixed. I used what you said and just tweaked it and now it works.

 

Here is what you requested:

 

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'https://botanicalgardenproducts.com'); // eg, [url="http://localhost"]http://localhost[/url] - should not be empty for productive servers
define('HTTPS_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); // eg, [url="https://localhost"]https://localhost[/url] - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', '.botanicalgardenproducts.com');
 define('HTTPS_COOKIE_DOMAIN', '.botanicalgardenproducts.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');
 define('DIR_WS_HTTP_CATALOG', '/shop/catalog/');
 define('DIR_WS_HTTPS_CATALOG', '');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('HTTP_CATALOG_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); 
 define('HTTPS_CATALOG_SERVER', 'https://www.botanicalgardenproducts.com/shop/catalog/'); 
 define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module   
 define('ENABLE_SSL', 'true'); // secure webserver for catalog 
 define('DIR_FS_DOCUMENT_ROOT', 'https://www.botanicalgardenproducts.com'); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/content/g/f/o/gfoster76021/html/shop/catalog/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

I do appreciate you spending most of your day helping me. Sometimes two heads work better than one and we got it fixed.

 

My new issue is getting rid of the IE problem of stating that there is secure and non-secure information and asking if the user wants to view both.

 

Again, thank you for your help but I was not working against you, I was working with what you gave me.

 

Clint ;)

Posted

Change these:

 

define('HTTP_SERVER', 'http://botanicalgardenproducts.com'); // eg, http://localhost - should not be empty for productive servers
define('DIR_WS_HTTPS_CATALOG', '/shop/catalog/');
define('HTTP_CATALOG_SERVER', 'http://www.botanicalgardenproducts.com/shop/catalog/');

In your /shop/catalog/stylsheet.css change these:

 

TD.background {
 background: #bbc3d3;
 background-image: url(/shop/catalog/images/body.jpg);
 width: 766px;
}

TR.header {
 background: #ffffff;
 background-image: url(/images/header.jpg);
height: 145px;
}

TD.headerNavigation {
 font-family: Script MT Bold, Arial, sans-serif;
 font-size: 14px;
 background: #bbc3d3;
 color: #ffffff;
 font-weight : bold;
 background-image: url(/images/nav.jpg);
 height: 88px;
 width: 766px;
}

TD.footer {
 font-family: Script MT Bold, Arial, sans-serif;
 font-size: 12px;
 background: #bbc3d3;
 color: #000000;
 font-weight: bold;
 background-image: url(/shop/catalog/images/footer3.jpg);
 height: 81px;
 width: 250px;
}

TD.footer1 {
 font-family: Script MT Bold, Arial, sans-serif;
 font-size: 12px;
 background: #bbc3d3;
 color: #000000;
 font-weight: bold;
 background-image: url(/shop/catalog/images/footer1.jpg);
 height: 81px;
 width: 258px;
}

TD.footer2 {
 font-family: Script MT Bold, Arial, sans-serif;
 font-size: 12px;
 background: #bbc3d3;
 color: #000000;
 font-weight: bold;
 background-image: url(/shop/catalog/images/footer2.jpg);
 height: 81px;
 width: 258px;
}

The only lines actually changed in the stylesheet are the "url" lines. The absolute references you have in there now are causing the "non secure" popup.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
Change these:

 

define('HTTP_SERVER', 'http://botanicalgardenproducts.com'); // eg, http://localhost - should not be empty for productive servers
define('DIR_WS_HTTPS_CATALOG', '/shop/catalog/');
define('HTTP_CATALOG_SERVER', 'http://www.botanicalgardenproducts.com/shop/catalog/');

In your /shop/catalog/stylsheet.css change these:

 

When I do that it goes back to the no images.

 

Thanks for the stylesheet info. Wasn't even thinking about that.

 

Clint

Posted

I screwed up on this one:

 

define('HTTP_CATALOG_SERVER', 'http://www.botanicalgardenproducts.com');

Make it that instead.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Almost there.

 

Post the code from your /shop/includes/footer.php

 

There are bad references to images there causing the non-secure popup again.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...