Force SSL

please…

It’s not a bug. SSL protocol uses https, you forced to use SSL.

Thanks for your replay sieks,

but when you read the post you can note that when force ssl is active, the directory name where dolibarr is installed isautomatically duplicated in the URL

That´s the problem, as that URL does not exists at all. https://mydomain/erp/erp main reason why I ask for some help, maybe nobody is using ssl or maybe is my dolibarr only, I´ll never know if nobody answer this post.

O i know understand your problem.
Try check conf.php file maybe there are this wrong entry who redirect to /erp/erp

[code]
htdocs --> conf --> conf.php[/code

Believe me, I’ve tried everything, so after many trials wrote the problem here, hoping for some help.

I hope someone can make that change in their own conf.php and tell me if it happens the same, then it would clearly be a bug and not a problem in my Dolibarr and I would be a little happier and wait for a fix from the masters.

Problems here too. I don’t even get an error, simply a redirect loop if I enable that option. I only can use SSL if I explicitly add https:// prefix (which I actually use). Quite weird. Maybe with an .htaccess rule could it be done too

1 Like

No solution, no answers, very frustrating

@planpc dolibarr version?

Hi ndrosis, actually 3.6.0

Hi planpc,
try edit file main.inc.php find below code

// $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off' if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') // If link is http { $newurl=preg_replace('/^http:/i','https:',DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]; }

and change wihte this

// $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off' if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') // If link is http { $newurl=preg_replace('/^http:/i','https:',DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]["L,R=301"]; }

and tetsing

1 Like

Thank you very much [url=www.dolibarr.org/#this-topic-no-longer-exists

after many tries impossible to me know where the problem was, with that change now it works fine and force to https in the correct path.

I will keep this thread, if I am not mistaken, when I will upgrade to a new version of dolibarr (3.6.x / 3.7.x), I will have this problem again.

A BIG THANK YOU !!

Hi,

Is it possible to know how your conf file is?

I have the same problem as you but the solution provided doesn’t work for me.

In your conf file, for the parameter $dolibarr_main_url_root, do you have
http://www.mydomain.com/erp” or “erp” pr “mydomain.com” or “httpS://www.mydomain.com/erp”?

I Installed dolibarr on a sub domain (erp.mydomain.com) and in my conf file, I used this value and I have the same problem, https doesn’t work at all :unhappy:

any help would be greatly appreciated!!!

thanks in advance! have a good one!

Hi,

I have the same problem… I installed dolibarr on a sub.domain.com.
My $dolibarr_main_url_root value is “sub.domain.com” (without http or https)

I have the same issue as you Planpc but the fix provided doesn’t work…

Any help?

(I use 3.6 version)

Before installed to that subdomain, does your dolibarr has been working on a domain or is a sub domain installation from scratch?

In my case is not a sub domain, so dont think my conf.php file could help you much more that the one included in dolibarr before installation, instead, if you publish which are the values in yours, maybe someone can help you find the right way.
I suppose in yours, must be the same with:

// Examples:
// $dolibarr_main_url_root=‘http://localhost’;
// $dolibarr_main_url_root=‘http://mydolibarrvirtualhost’;
// $dolibarr_main_url_root=‘http://myserver/dolibarr/htdocs’;
// $dolibarr_main_url_root=‘http://myserver/dolibarralias’;

$dolibarr_main_url_root='https://sub_domain.com’;

Did you try

1 Like

I recently updated from 3.6.0 to 3.7.0, then main.inc.php is replaced and the problem to force SSL reappears.

The solution provided by ndrosis Works Fine.

Where can I notify this bug so the programmer group can take it for future versions?

Thank you all

We look for the best solution.
In order not you have a problem with the upgrades better use the .htaccess

1 Like

In Dolibarr version 8 to force SSL you need to change in config.php file as Eldy said $dolibarr_main_force_https='0'; to $dolibarr_main_force_https='https://yourdomain.com/';
I’m pretty sure that applies to all Dolibarr versions.

Just change the .htacess file

write on it:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

which one be more specific please