Page 1 of 1

Force https on all pages

Posted: Fri Jun 21, 2019 7:06 pm
by TomSut
Iv'e installed the SSL Certificate, changed both config files from http to https, put the rewrite code into .htaccess file.

https site works fine but customers are not getting redirected when they click on old http links on old newspaper articles, google etc.

http://pubstops.co.uk/index.php?route=p ... uct_id=132
https://pubstops.co.uk/index.php?route= ... uct_id=132

Any thoughts where iv'e gone wrong?

Thanks

Tom

Opencart 3.0.2.0

Re: Force https on all pages

Posted: Fri Jun 21, 2019 7:44 pm
by dparakhiya
Share your .htaccess rewrite code...

Re: Force https on all pages

Posted: Fri Jun 21, 2019 7:47 pm
by straightlight
Please use the forum / Google search. Lots of solutions about those requests: viewtopic.php?f=202&t=211813&p=755463#p755463

Re: Force https on all pages

Posted: Fri Jun 21, 2019 8:05 pm
by TomSut
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^pubstops\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.pubstops\.co\.uk$
RewriteRule ^/?$ "https\:\/\/pubstops\.co\.uk\/" [R=301,L]

Re: Force https on all pages

Posted: Fri Jun 21, 2019 9:19 pm
by EvolveWebHosting
If your hosting provider is updated to cPanel v80, you can also use the new HTTPS redirection manager: https://blog.cpanel.com/force-https-redirection/

Re: Force https on all pages

Posted: Fri Jun 21, 2019 11:49 pm
by TomSut
Thought i was on for a winner with cPanel but our host isn't using the new version.

Also tried in .htaccess

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

That doesn't work.

Re: Force https on all pages

Posted: Sat Jun 22, 2019 10:58 am
by letxobnav

Code: Select all

	RewriteCond %{HTTPS} off
	RewriteCond %{REQUEST_URI} !.*\.(ico|cur|mp3|mpeg|webp|svg|ttf|eot|woff|woff2|gif|jpg|jpeg|png|swf)
	RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L]

Re: Force https on all pages

Posted: Sun Jun 23, 2019 1:26 am
by EvolveWebHosting
TomSut wrote:
Fri Jun 21, 2019 11:49 pm
Thought i was on for a winner with cPanel but our host isn't using the new version.

Also tried in .htaccess

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

That doesn't work.
Could you PM me the contents of your .htaccess file? I can then review and edit it and send it back to you. You can then make a backup of your current .htaccess file and try the changes I send to you.