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.
See these solutions:
viewtopic.php?f=10&t=199046&p=701638#p701638
viewtopic.php?f=181&t=170631&p=669871#p669871
viewtopic.php?f=10&t=199046&p=701638#p701638
viewtopic.php?f=181&t=170631&p=669871#p669871
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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]
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]
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?
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?
Who is online
Users browsing this forum: integraa and 268 guests