Too many Redirects when accessing Roundcube

My bad, I didn’t drive attention towards the http -> https redirection issue.
I also prefer the first option for the FQDN to prevail.

In addition to the roundcube config changes, yesterday tried an additional change, this time on /etc/httpd/conf.d/default-virtualhost.inc file, removing the \ escape chars:

RewriteEngine On
RewriteRule ^/webmail(/.*)?$ https://%{HTTP_HOST}/webmail$1 [R=301,L]
RewriteRule ^/roundcubemail(/.*)?$ https://%{HTTP_HOST}/roundcubemail$1 [R=301,L]

And the http to https worked with the FQDN and with the virtualhost.
Bear in mind I’ve no clue neither about rewrite rules nor vhosts, so if this is wrong… shame on me.:blush:


P.S. with other virtual hosts redirections (i.e. /server-manager) it’s looking for it on /var/lib/nethserver/vhost/whatever/server-manager, which might be the expected behavior.

[details=See log excerpt]

[ssl:debug] Connection closed to child 6 with standard shutdown (server pippo.org:80)
[rewrite:trace2] init rewrite engine with requested uri /server-manager
[rewrite:trace3] applying pattern ‘(.)’ to uri ‘/server-manager’
[rewrite:trace4] RewriteCond: input=‘off’ pattern=’!=on’ => matched
[rewrite:trace2] rewrite ‘/server-manager’ -> ‘https://pippo.org/server-manager
[rewrite:trace2] explicitly forcing redirect with https://pippo.org/server-manager
[rewrite:trace1] escaping https://pippo.org/server-manager for redirect
[rewrite:trace1] redirect to https://pippo.org/server-manager [REDIRECT/302]
[ssl:debug] Connection closed to child 0 with standard shutdown (server pippo.org:80)
[ssl:debug] HTTPS request received for child 4 (server pippo.org:80)
[rewrite:trace2] init rewrite engine with requested uri /server-manager
[rewrite:trace3] applying pattern '(.
)’ to uri ‘/server-manager’
[rewrite:trace4] RewriteCond: input=‘on’ pattern=’!=on’ => not-matched
[rewrite:trace1] pass through /server-manager
[authz_core:debug] AH01626: authorization result of Require ip 127.0.0.1 192.168.0.0/255.255.255.0: granted
[authz_core:debug] AH01626: authorization result of : granted
[authz_core:debug] AH01626: authorization result of : granted
[core:info] AH00128: File does not exist: /var/lib/nethserver/vhost/pippo/server-manager
[ssl:debug] AH02001: Connection closed to child 4 with standard shutdown (server pippo.org:80)
[/details]
2 Likes