Post by leeburgess » Wed Sep 05, 2018 10:44 pm

OC 3.0.2.0

If someone visits my site at http://example.co.uk how can I set it so it goes to http://www.example.co.uk and also always to us Https? SSL is enabled in admin.

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Wed Sep 05, 2018 10:56 pm


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 leeburgess » Fri Sep 07, 2018 4:52 am

Thank you if I type the following it works great but SEO URLs no longer work.

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by leeburgess » Sat Sep 08, 2018 1:00 am

Anyone know how to resolve this please?

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by leeburgess » Sun Sep 09, 2018 10:48 pm

Anyone?

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by MrPhil » Sun Sep 09, 2018 11:12 pm

Please don't be so impatient. The people responding are volunteers, and it is the weekend.

First, see my update today to one of the suggested fixes: viewtopic.php?f=181&t=170631 . The given solution is not optimal, but I don't know if it has a bearing on your case. When you say it breaks SEO, could you give an example URL that works, and one that doesn't, and what happens? An R=301 should update the visible address in the browser (for the benefit of the user or the search engine), but you don't want to use it for rewrites to internal forms (e.g., index.php?keyword=value&keyword=value). The usual practice is to put the return status code (R=301) first and the leave flag (L) second, but I don't know if some servers see a difference. Do you have any other rewrites or redirects, especially ahead of this one? A generic rewrite/redirect like this one should come before rewrites for SEO->real URL. Finally, you are on a server (e.g., Apache) that reads and processes an .htaccess file, right?

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm
Who is online

Users browsing this forum: integraa and 268 guests