Force HTTPS from start

I have set up a certiificate, is there anywhere in the config that would ensure that any http request to it gets moved to https?

Thanks in advance

Jonathan

@jnash
Change variable ‘site_url’ in file: config.php.

Thank you however have done that however if accessing it from http it doesn’t not switch to https

@jnash
It don’t switch to https. It will generate links with https. You should change config of your web server (apache, nginx, …) or change file ‘.htaccess’ for switching.

Thanks, which links does it generate as when I’m in the app I would clicking on links still goes to http, I’m assuming let now are relative on the site and that means no option to use http in the url

@jnash
It’s 2 differnt situations.

  1. Suite sometimes generate directly links (for example: in emails) and use variable ‘site_url’ for it.
  2. Only web server can redirect protocol http to https only for SuiteCRM.

If your session use http protocol when starting then all relative links will use http too.

Under your CRM folder open the .htaccess file and add this - worked for me

#redirect to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^index\.php$ https://example.com/CRM/index.php [R,L]
1 Like

Thank you very much, that worked perfectly.

1 Like

Looking like a good fix - thanks