Post by JohnFPL » Tue Jan 10, 2017 4:18 pm

I know this has been written about numerous times, but I have followed the various suggestions and can not solve the issue.

I have just switched v2.0.1.1 to https.
Settings --> Server Use SSL = yes

Root config file:
// HTTP
define('HTTP_SERVER', 'https://www.mydomain.co.uk/');
// HTTPS
define('HTTPS_SERVER', 'https://www.mydomain.co.uk/');

Admin config file:
// HTTP
define('HTTP_SERVER', 'https://www.mydomain.co.uk/admin/');
define('HTTP_CATALOG', 'https://www.mydomain.co.uk/');
// HTTPS
define('HTTPS_SERVER', 'https://www.mydomain.co.uk/admin/');
define('HTTPS_CATALOG', 'https://www.mydomain.co.uk/');

root .htaccess file:
#permanent redirect to www and https
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.co.uk [NC] [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.mydomain.co.uk/$1 [R,L]

Before the switch to https all requests were redirected to www. Since the swicth, all requests, no matter how prefixed are redirecting as expected ie https://www.mydomain etc.

Any suggestions would be appreciated. I am using Nitro Pack for caching and get the same missing icons whether this is enabled or not.

Thanks in advance

New member

Posts

Joined
Sat May 04, 2013 7:43 pm

Post by opencartmart » Tue Jan 10, 2017 5:08 pm

Possible to share site URL?

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by paulfeakins » Tue Jan 10, 2017 6:10 pm

It looks like your config file is correct, perhaps it is the CSS where the icons are called that needs HTTPS?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JohnFPL » Tue Jan 10, 2017 6:29 pm

opencartmart wrote:Possible to share site URL?
https://www.oakandpersonal.co.uk/

New member

Posts

Joined
Sat May 04, 2013 7:43 pm

Post by JohnFPL » Tue Jan 10, 2017 6:32 pm

paulfeakins wrote:It looks like your config file is correct, perhaps it is the CSS where the icons are called that needs HTTPS?
Paul, where or how can I determine this?

New member

Posts

Joined
Sat May 04, 2013 7:43 pm

Post by opencartmart » Tue Jan 10, 2017 8:29 pm

It seems that something wrong in your rewrite rule. When I tried to access font files, it is giving html response instead of font https://www.oakandpersonal.co.uk/catalo ... f?v=4.1.0n
Last edited by opencartmart on Tue Jan 10, 2017 11:07 pm, edited 2 times in total.

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by k2tec » Tue Jan 10, 2017 9:26 pm

Why www. www= a subdomain
My htaccess:

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 
# 2. In your opencart directory rename htaccess.txt to .htaccess.
# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
#RewriteCond %{HTTPS} on

#SSL Port
RewriteCond %{SERVER_PORT} !=443

# Remove www. from any domain query
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [R=301,L]

# All broswer request get redirected to HTTPS
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC]
 RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

User avatar
Active Member

Posts

Joined
Mon Apr 12, 2010 8:06 pm

Post by Gobbo » Mon Apr 24, 2017 8:31 pm

Did this sort out the problem?

As I'm having the same issue.

Using opencart 3.0.3.2 - PHP 7.4 - Standard Template - Add to Cart Enable Disable Out of Stock Product 3.x - Export/Import Tool (V3.22) for OpenCart 3.x - Footer Social Media Link( 3.x ) v1.0


Active Member

Posts

Joined
Tue Jun 22, 2010 12:38 am

Post by IP_CAM » Tue Apr 25, 2017 11:01 am

If you want to have your 'font-awesome' type Icons working, regardless of, how the site is beeing called,
you could change the font-awesome.css link, to make it as shown below, in your
...theme/template/common/header.tpl:
//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css

STILL, the correct way to run OC is, to re-route a URL in the .htaccess file, to look like,
as declared in the config.php Files, by use of something like this:
(Rerouting http(s)://SITE Calls to http(s)://www.SITE)

Code: Select all

#Force (http host) non www to www (optional)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Force (https host) non www to www (optional)
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Good Luck!
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 JohnFPL » Tue Apr 25, 2017 12:32 pm

The problem was caused by my hosting provider. They were redirecting https traffic on load balancers rather than directly on the server. Now that they have adjusted their configuration to the industry standard, the settings in my config.php files and htaccess now work as expected.

New member

Posts

Joined
Sat May 04, 2013 7:43 pm

Post by sculptex » Tue Apr 25, 2017 4:44 pm

A combined rule for WWW/HTTPS htaccess sounds good but in practice can be problematic. Having two separate is neater. Go to your site with HTTPS but without WWW. and it still won't work properly, also if you ever wanted multisite because you hardcoded url. Try code Ernie posted instead it looks very similar to code I always use.

ImageImage


User avatar
Active Member

Posts

Joined
Tue Sep 13, 2011 3:07 am
Location - UK
Who is online

Users browsing this forum: No registered users and 245 guests