Change link nextcloud

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