Page 1 of 1

Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 5:01 am
by steverdezines
I've enabled SSL, yet it's still not working. Attached is a screenshot is the result of an SSL checker, and a screenshot of my web browser showing https. What else do I need to do?

Re: Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 5:19 am
by IP_CAM
Well, SSL cannot just be switched on, by clicking it on in Admin,
and possibly inserting some Reroute-Command into the .htaccess
file, as long as the config.php defined HTTP(S):// routing is not
set right. Check in your both config.php files, if the Links are
written similar to the links shown below:

It needs to look like: (http:// www. yourshopsite)

Code: Select all

// HTTP
define('HTTP_SERVER', 'http://www.hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'http://www.hitline.info/shop/');
Or: (http:// yourshopsite)

Code: Select all

// HTTP
define('HTTP_SERVER', 'http://hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'http://hitline.info/shop/');
Or: (https:// www. yourshopsite)

Code: Select all

// HTTP
define('HTTP_SERVER', 'https://www.hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'https://www.hitline.info/shop/');
Or: (https:// yourshopsite)

Code: Select all

// HTTP
define('HTTP_SERVER', 'https://hitline.info/shop/');
// HTTPS
define('HTTPS_SERVER', 'https://hitline.info/shop/');
It has been mentioned uncounted times already, but it's hard
to find something in this place. I therefore advise anyone,
looking for OC answers, to check Google first, by using a few
Keywords, and with the OpenCart Name after the Keyword
Quotation, like: "SSL+Problems"+Opencart

Ernie

Re: Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 8:44 am
by steverdezines
Thanks, Ernie. I did do the search before I came here, and I found an answer and did my best to follow the instructions. I've fixed both the config.php files in awakeraisingawareness.com and admin. See attached. Was there somewhere I missed? I did, however, look at the .htacess file, and I found a couple of them. I inserted the code I found and substituted my domain, but it didn't work. In fact, I wasn't sure where to put it in the the .htacess file. This is the code I used:

# force both https and www. in one go
RewriteEngine On
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.awakeraisingawareness.com

Here's the link to those instructions: https://youtu.be/jf-XZ9tGewo

Here's the link to the instructions regarding the config.php files. https://youtu.be/jf-XZ9tGewo
Thanks

Re: Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 9:15 am
by IP_CAM
Some of those .htaccess 'Reroute-Routines' work on some Servers,
and others don't, it depends on how a Server is configured, I guess.
You might find another Routine, to test it out.
Ernie
https://github.com/IP-CAM/htaccess-rules

Re: Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 9:35 am
by letxobnav

Code: Select all

# force both https and www. in one go
RewriteEngine On
RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.awakeraisingawareness.com
will redirect any non-ssl request or any not having www to your home page.
You do not need to do this in one go as it makes no sense, two separate statements also constitute an OR function.

Code: Select all

# redirect non-ssl requests to ssl
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]

# redirect any request not having www to ssl with www
RewriteCond %{HTTP_HOST} ^awakeraisingawareness\.com [NC]
RewriteRule ^(.*)$ https://www.awakeraisingawareness\.com/$1 [L,R=301]
(assuming your server name is set correctly with www included)

besides, the "www" redirects are generally unnecessary unless you are putting links out there (bots, etc.) which do not have "www" included and why would you?

Re: Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 9:50 am
by steverdezines
Thanks. I'm not well versed...actually hardly at all....with coding of this nature. The best I can do is look at it, and guess as to where I'm to enter my domain name. Below are the samples from the Github site you referred. I’ve numbered the samples I’m working with for reference purposes only.

Regarding #'s 2,3 and 4, I replaced the "example" domain with my domain. #'s 1 and 5...I have no idea where to put my domain name. Regarding the rest of the coding that sits below #5...I have no clue what to do with that.

If you could tell me where to put my domain name on 1 and 5, and whether I was correct on #’s 2,3 and 4, that would be great. And if I am incorrect on those, could you give me a hint as to how I can correct them?

As far as the coding below #5 goes, if you can give me some constructive input, that would be fabulous. If not, I understand.


1.
IfModule mod_rewrite.c>
# Redirect all traffic to https://www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
</IfModule>

2.
<IfModule mod_rewrite.c>
# Redirect all traffic to https://www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) https://www.awakeraisingawareness.com%{REQUEST_URI} [NE,L,R=301]
</IfModule>

3.
<IfModule mod_rewrite.c>
# Redirect all traffic to https:// non www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://www.awakeraisingawareness.com%{REQUEST_URI} [R=301,L]
</IfModule>
4.
<IfModule mod_rewrite.c>
# Redirect all traffic to https:// subdomain
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.awakeraisingawareness.com%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
</IfModule>

5.
<IfModule mod_rewrite.c>
# Cloudflare
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

I put my text in bold, not to yell at you, but to distinguish mine from the Github text. I hope I was clear on all of the above. If not, let me know, and I'll try again.

Thanks@ [/b}

Re: Make sure you have SSL enabled on your checkout page

Posted: Mon May 20, 2019 10:03 am
by steverdezines
Okay, letxobnav, You are saying if I insert the code you wrote, see below, into my .htacces file, then I have a good chance it will work...Assuming my server name is set correctly with www included?

# redirect non-ssl requests to ssl
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]

# redirect any request not having www to ssl with www
RewriteCond %{HTTP_HOST} ^awakeraisingawareness\.com [NC]
RewriteRule ^(.*)$ https://www.awakeraisingawareness\.com/$1 [L,R=301]

Thanks!

Re: Make sure you have SSL enabled on your checkout page

Posted: Thu May 23, 2019 1:13 pm
by steverdezines
Can Anyone help with the .htacess file. What coding I need to use, and where in the file do I need to insert it? Someone help!

Re: Make sure you have SSL enabled on your checkout page

Posted: Thu May 23, 2019 1:55 pm
by letxobnav
did you try my suggestion?

Re: Make sure you have SSL enabled on your checkout page

Posted: Thu May 23, 2019 2:01 pm
by steverdezines
I did. I sent you a PM that very same day. Apparently you did not receive it. Here it is:
Hey letxobnav , Thanks for the help. Much appreciate! I've been stumped, and it's been looking a little bleek today.

# redirect non-ssl requests to ssl
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !.*\.(ico|txt|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|JPG|jpeg|JPEG|png)
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]

# redirect any request not having www to ssl with www
RewriteCond %{HTTP_HOST} ^awakeraisingawareness\.com [NC]
RewriteRule ^(.*)$ https://www.awakeraisingawareness\.com/$1 [L,R=301]


I inserted the code you wrote into my root .htacess file...saved it, and when I tested it, the front side worked perfectly, but the admin didn't accept my user/password. So, I deleted the code, and now it both sides work again. Have any thoughts about why your code didn't work? Could it be that the server name is not set correctly with www included like you said?

Re: Make sure you have SSL enabled on your checkout page

Posted: Fri May 24, 2019 8:53 am
by letxobnav
well, assuming is never good in IT so either ask your host what they defined as your server name (assuming you are hosted, damn assuming again) or you can add in catalog/controller/product/product.php:

just after:

Code: Select all

	public function index() {
this:

Code: Select all

	$this->log->write('My Server variables '.print_r($_SERVER,true));

and that will list your server variables in your oc log file.

you only have to do that once and then make a note of it or comment it out again.

this should have a line:

Code: Select all

[SERVER_NAME] => YOUR SERVER NAME
and hopefully that has www in it.

do that first so you know what we deal with.

you might also post what you have in config.php and admin/config.php wrt HTTP_SERVER and HTTPS_SERVER.

Re: Make sure you have SSL enabled on your checkout page

Posted: Fri May 24, 2019 9:06 am
by straightlight
To keep the convention on-going with OC:

Code: Select all

$this->log->write('My Server variables '.print_r($_SERVER,true));
to read:

Code: Select all

$this->log->write('My Server variables '.print_r($this->request->server, true));

Re: Make sure you have SSL enabled on your checkout page

Posted: Fri May 24, 2019 9:21 am
by letxobnav
well, that line was not intended for the next OC release.

Re: Make sure you have SSL enabled on your checkout page

Posted: Sat May 25, 2019 12:31 pm
by steverdezines
Thanks guys! I do have a host... Godaddy. I'll give it a try.