Post by steverdezines » Mon May 20, 2019 5:01 am

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?

Attachments

Screen Shot 2019-05-19 at 2.30.46 PM.png

Screen Shot 2019-05-19 at 2.30.46 PM.png (131.06 KiB) Viewed 1351 times

Screen Shot 2019-05-19 at 2.38.30 PM.png

Screen Shot 2019-05-19 at 2.38.30 PM.png (612.11 KiB) Viewed 1351 times


User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN

Post by IP_CAM » Mon May 20, 2019 5:19 am

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

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by steverdezines » Mon May 20, 2019 8:44 am

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

Attachments

awake-config.jpg

awake-config.jpg (106.9 KiB) Viewed 1319 times

admin-config.jpg

admin-config.jpg (94.94 KiB) Viewed 1319 times


User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN

Post by IP_CAM » Mon May 20, 2019 9:15 am

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

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by letxobnav » Mon May 20, 2019 9:35 am

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?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by steverdezines » Mon May 20, 2019 9:50 am

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}
Last edited by steverdezines on Thu May 23, 2019 1:12 pm, edited 1 time in total.

User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN

Post by steverdezines » Mon May 20, 2019 10:03 am

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!

User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN

Post by steverdezines » Thu May 23, 2019 1:13 pm

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!

User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN

Post by letxobnav » Thu May 23, 2019 1:55 pm

did you try my suggestion?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by steverdezines » Thu May 23, 2019 2:01 pm

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?

User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN

Post by letxobnav » Fri May 24, 2019 8:53 am

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.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Fri May 24, 2019 9:06 am

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));

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Fri May 24, 2019 9:21 am

well, that line was not intended for the next OC release.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by steverdezines » Sat May 25, 2019 12:31 pm

Thanks guys! I do have a host... Godaddy. I'll give it a try.

User avatar
Newbie

Posts

Joined
Mon Jan 14, 2019 4:00 am
Location - Sartell, MN
Who is online

Users browsing this forum: Bing [Bot] and 386 guests