How can I force Sugar to use https?
Didn't see any flag in the config file or option anyplace.
How can I force Sugar to use https?
Didn't see any flag in the config file or option anyplace.
It would be more of a server thing than a Sugar thing. If you have SSL activated on your server and your config file is right Sugar should work in https without change. You may have to change the site URL in your config.php file.Originally Posted by jimatbes
Kenneth Brill - Help Forum Moderator
I do not respond to 'Private Messages'. Please email me directly instead
When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
Help us Help You
Thanks for the quick reply!
Will the following in config.php force the use of https, preventing access with http (i.e., ensuring encrypted communications always)?
Code:array ( 'persistent' => true, 'autofree' => false, 'debug' => 0, 'seqname_format' => '%s_seq', 'portability' => 0, 'ssl' => true, ), ... 'site_url' => 'https://mysite.com/sugar_directory',
Those are both valid settings, but again, forcing SSL should be done at the server level not the program level. If you want no access to Sugar on port 80 either turn off port 80 (http) or configure your server not to allow non-ssl access to the Sugar directory.
Kenneth Brill - Help Forum Moderator
I do not respond to 'Private Messages'. Please email me directly instead
When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
Help us Help You
If you are using Apache, you can use mod_rewrite to force any http connections to https. Here is an example virtual host that redirects to https:
<VirtualHost *:80>
ServerName mysugar.domain.com
DocumentRoot /path/to/Sugar
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
Here's the way I configured sugar to work with SSL. I modified index.php in the root of my sugar install and right below the copyright notice I add the following.
And you have to also update your config.php URL as you have so emails from Sugar will be sent out properly.PHP Code:// Added for SSL Connection by Grimlock
if ($_SERVER['SERVER_PORT'] != 443) { header("Location: https://www.mywebsiteurl.com/sugar"); exit; } //
One reason I've removed this is because Sugar was super slow since it reloads images, JavaScript files and CSS files when SSL is forced.
Good luck!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks