Change link nextcloud

NethServer Version: 7.9 up date
Module: email , nextcloud , webmail, collabora
i wold change the link for webmail and nextcloud.
i wont add https://mydomain.com/drive and https://mydomain.com/posta
please help me

thanks

1 Like

You could add alias to the httpd config files. So Nextcloud is still reachable via /nextcloud but also via /drive. This way you can safely add a custom template fragment and existing setups still work.

Nextcloud:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf.d/zz_nextcloud.conf/

Create /etc/e-smith/templates-custom/etc/httpd/conf.d/zz_nextcloud.conf/90alias with following content:

# 90alias - Custom template

Alias /drive /usr/share/nextcloud/

signal-event nethserver-nextcloud-update

It’s the same for Roundcube:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf.d/roundcubemail.conf/

Create /etc/e-smith/templates-custom/etc/httpd/conf.d/roundcubemail.conf/90alias with following content:

# 90alias - Custom template

Alias /posta /usr/share/roundcubemail

signal-event nethserver-roundcubemail-update

EDIT:

HTTPS redirect for Nextcloud and Roundcube:

Create custom template dir:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf.d/default-virtualhost.inc/

Create /etc/e-smith/templates-custom/etc/httpd/conf.d/default-virtualhost.inc/30customredirect with following content:

#
# 30customredirect roundcube and nextcloud
#
RewriteEngine On
RewriteRule ^/posta(/.*)?$ https://%\{HTTP_HOST\}/posta$1 [R=301,L]
RewriteRule ^/drive(/.*)?$ https://%\{HTTP_HOST\}/drive$1 [R=301,L]
Redirect 301 /ocm-provider /drive/ocm-provider
Redirect 301 /ocs-provider /drive/ocs-provider

Apply config:

signal-event nethserver-nextcloud-update; signal-event nethserver-roundcubemail-update

5 Likes

Thenks mrmarkuz for yoou replay.

Does this allow me not to replicate the change when I update nethserver from software center?

thanks

Yes, the custom templates should still work after updates.

1 Like

Hello mrmarkuz for you replay.
BUT http://miodominio.com/nextcloud redirect in https to https://miodominio.com/nextcloud
the http://miodominio.com/drive not redirect to https://miodominio.com/drive but it remains in http with an unsafe site report.

obviously if dgt in HTTPS https://miodominio.com/drive, it works regularly.

please help me
thanks

You’re right, the HTTPS redirect is missing. I added the custom template to my previous post.

1 Like

Hello mrmarkuz for you replay.
it is ok and work fine.
thanks
thanks

1 Like