Post by JoaniesGifts » Sun May 29, 2011 11:18 pm

Hi Guys,

Really bad day today trying to fix this without much luck - hope you can help. I'm not very technical but have got my hands dirty with Opencart over the last few months so just a heads up.

Background
my website is http://www.joaniesgifts.co.uk/store/ is hosted by 123-reg.co.uk on a shared linux/apache server.

- I recently ordered SSL and this is now installed correctly.
- i changed the admin/config.php in line with the instructions (http to https etc).
- I enabled ssl in the administration screen itself.
- i ensured that any template modifications werent affecting ssl

Problem.
The issue i'm having is that the pages are only appearing partially encrypted because the "base href" is switching back to http (if i view page source). The page itself remains in https mode but when I view/source I can see the base href is http as well as all the links.

Workaround
I've switched off SSL in the admin screen and simply set my store URL to be https://www.joaniesgifts.co.uk/store
This makes everything work correctly but obviously the store's catalog is much slower which isnt what i want.

Questions
Can anyone either :-
- tell me how to resolve this.
- give me a workaround that can fix this (perhaps with javascript).
- tell me what i should be asking my hosting company.

For now, I'll leave the site in https mode but im really hoping someone can help me :(

Kind Regards,
Joan
Last edited by JoaniesGifts on Thu Sep 08, 2011 4:11 am, edited 1 time in total.

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by webpie it. » Sun May 29, 2011 11:39 pm

I don't really understand, i had a look at view source and the generated source, and everything looks correct, on causl pages such as categories, brands etc.... http is used, when going on the account, login etc... https is called upon?

Do i make any sense or have i read your problem wrong?

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by JoaniesGifts » Sun May 29, 2011 11:56 pm

Hi thanks for the quick reply.
I've had to enable SSL at the site level (in the admin "store url" field) to fix the issue, so you probably cant see the issue at the moment. It's not ideal though.

The trouble i'm having is that when ssl is enabled properly ("use ssl" under server admin), the base href from index.php is not writing the https addresses, only the http addresses. This is then giving me a partially encryped page.

What do you think it could be?

Kind Regards, Joan

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by webpie it. » Mon May 30, 2011 12:06 am

Could you paste your config.php from the admin area on here.

Just want to see what you've got.

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by JoaniesGifts » Mon May 30, 2011 1:17 am

Sure, the main part is :-

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.joaniesgifts.co.uk/store/admin/');
define('HTTP_CATALOG', 'http://www.joaniesgifts.co.uk/store/');
define('HTTP_IMAGE', 'http://www.joaniesgifts.co.uk/store/image/');

// HTTPS
define('HTTPS_SERVER', 'https://www.joaniesgifts.co.uk/store/admin/');
define('HTTPS_IMAGE', 'https://www.joaniesgifts.co.uk/store/image/');

Strangely, my admin page works fine.

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by JoaniesGifts » Mon May 30, 2011 1:24 am

I've set the "site url" back to be http: and the "use ssl" to be yes in the admin screen. So the problem is currently live.
Once you get to checkout, the SSL is only partially encrypted because the base href of index.php hasnt written the https correctly.

This is taken from the checkout page when I view source.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>
<title>Delivery Information</title>
<base href="http://www.joaniesgifts.co.uk/store/" />
<link href="http://www.joaniesgifts.co.uk/store/image/data/joanies.png" 
KR, Joan

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by webpie it. » Mon May 30, 2011 1:42 am

Hmm this is strange.

The onyl thing i can think of trying for you is trying this:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.joaniesgifts.co.uk/store/admin/');
define('HTTP_CATALOG', 'http://www.joaniesgifts.co.uk/store/');
define('HTTP_IMAGE', 'http://www.joaniesgifts.co.uk/store/image/');

// HTTPS
define('HTTPS_SERVER', 'https://www.joaniesgifts.co.uk/store/admin/');
define('HTTPS_IMAGE', 'https://www.joaniesgifts.co.uk/store/image/');
define('HTTPS_CATALOG', 'https://www.joaniesgifts.co.uk/store/');
Just curious if you can force ssl on catalog, give it a try.

Otherwise i'm a little stumped on this issue.

The only other thing it could be is if one of your core files has been altered.

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by webpie it. » Mon May 30, 2011 1:49 am

Possibly this:


<script type="text/javascript">
$(function(){
if($('#slideshow').length === 1)
var mygallery=new fadeSlideShow({
wrapperid: "slideshow",
dimensions: [570, 200],
imagearray: [
["catalog/view/theme/joanie/image/east-of-india.jpg", "http://www.joaniesgifts.co.uk/store/east-of-india", "_self", ""],
["catalog/view/theme/joanie/image/kokeshi.jpg", "http://www.joaniesgifts.co.uk/store/kokeshi", "_self", ""],
["catalog/view/theme/joanie/image/vietnam.jpg", "http://www.joaniesgifts.co.uk/store/vietnamese", "_self", ""],
["catalog/view/theme/joanie/image/handmade_jewellery.jpg", "http://www.joaniesgifts.co.uk/store/jewellery", "_self", ""],
["catalog/view/theme/joanie/image/toys.jpg", "http://www.joaniesgifts.co.uk/store/toys", "_self", ""]
],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
persist: false,
fadeduration: 700,
descreveal: "ondemand",
togglerid: ""
})
});
</script>

If these are hard coded in the backend, as http, then this could be the problem, try going tinto the backend where you edit the the link and add https.

I assume you can edit the location of these?

Anyway this could be a possibility

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by JoaniesGifts » Mon May 30, 2011 1:54 am

Hi thanks but I tried that one a little earlier and it didnt help.

Oh and just saw your post - i tried removing that javascript by reverting back to the default template but there's still an issue which makes me think it's server side in my case.

Question.
Do you know if there is a way to force index.php to behave as though site url is https://www.joaniesgifts.co.uk/store, but only on certain pages such as the checkout/confirm page?

Setting site url to the https version of my site fixes the problem but i dont want all of my pages to be ssl (for speed and SEO reasons).

KInd Regards
Joan

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by webpie it. » Mon May 30, 2011 1:57 am

Hmm i'm sorry i can't help you there, i'll try and direct some attention over to this topic for you, so you can get it solved fast, sorry i can't be much more help.

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by JoaniesGifts » Mon May 30, 2011 2:07 am

Thanks for trying and if you know anyone else that might be able to help - I'd appreciate that :-)

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by Xsecrets » Mon May 30, 2011 3:05 am

look in catalog/controller/common/header.php there are a couple of places where the base href is set.

like so

Code: Select all

$this->request->server['HTTPS']  
if your server does not respect the $_SERVER['HTTPS'] variable it won't work. You will need to contact your hosting company to find out what variable you need to check to see if you are in SSL mode. Most hosts HTTPS is fine, but some require a different variable, and on one that I know of (network solutions) does not have any variable that you can check to see if you are in https mode. In that case you are just out of luck and it will not work.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by JoaniesGifts » Mon May 30, 2011 4:28 am

Thanks xSecrets I was beginning to think the same thing I'll email them on Tuesday (bank holiday here in the UK).

Do you think there's something I can do within the code to say something like :-

If URL contains checkout/confirm then base href=https://www.joaniesgifts.co.uk/store

so something like

Code: Select all

<?php
if($_SERVER["REQUEST_URI"]=="/store/index.php?route=checkout/confirm")
$base='https://www.joaniesgifts.co.uk/store/>';
else
echo '<base href='.$base.'>';
?>
Kind Regards,
Joan

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK

Post by Xsecrets » Mon May 30, 2011 1:35 pm

you can do

Code: Select all

$this->request->get['route'] 
to find the variable, but Your hosting should have one of the server variables available that you can check to see if you are in https mode.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by JoaniesGifts » Mon May 30, 2011 6:32 pm

Thank you, I will ask them on Tuesday (fingers crossed).

In the mean time, it's not elegant but I've developed a workaround.
I essentially check the page name's request string is like 'confirm' , switch to https mode, supress my best sellers module on the right and then change the base href and logos to https for that page only. I have to suppress the module or I get a partially encryped page due to images from the cache being on http...

Bulk of code is changed in the header template.

Code: Select all

<?php
if($_SERVER["REQUEST_URI"]=="/store/index.php?route=checkout/confirm" || $_SERVER["REQUEST_URI"]=="/store/index.php?route=checkout/guest_step_3")
$base='https://www.joaniesgifts.co.uk/store/>';
$icon='https://www.joaniesgifts.co.uk/store/image/data/joanies.png';
$logo='https://www.joaniesgifts.co.uk/store/image/data/JoaniesGifts_Logo.jpg';
?>
<base href="<?php echo $base; ?>" />
Not elegant, but it works, paypal fires correctly and everything is secured.

Thoughtful Gifts by Joanie's Gifts - The Thought Counts...


User avatar
Active Member

Posts

Joined
Fri Oct 29, 2010 8:59 pm
Location - UK
Who is online

Users browsing this forum: No registered users and 67 guests