Access Nextcloud using alternate path

nextcloud
v7

(Dan) #1

NethServer Version: 7.4
Module: Nextcloud

More on looking at migration from SME… On my existing SME Server, I have Nextcloud running. It’s a legacy installation from source, over Owncloud, having upgraded a version at a time since probably Owncloud 6.x. Most of my users access it at www.myserver/owncloud. A couple of my users reach it at www.secondarydomain. So, a couple of simple questions:

  • Can I set an alias such that www.nethserver/owncloud points to www.nethserver/nextcloud?
  • Can I configure a secondary domain so that www.secondarydomain/ brings up the same nextcloud installation?

(Ralf Jeckel) #2

Hi Dan,

If I understood right, I think this can help you :


(Dan) #3

Wow, it’s been a while since I started this topic. That topic helped a bit, but doesn’t quite get me there (though I may be able to work it out with some help from Google). Let’s ignore the second point for now and look at the first–redirecting domain.tld/owncloud to domain.tld/nextcloud.

Looks like the way to do that is by using Apache’s rewrite engine, and probably either writing up a template fragment or directly editing one of its config files. That’s going to take a little more reading to figure out. Pointers would be appreciated, otherwise I’ll update with what I find.


(Dan) #4

Well, I think I have it working. Here’s what I’ve done; you can tell me what I have wrong (or could improve).

I created a custom template fragment at /etc/e-smith/templates-custom/etc/httpd/conf.d/default-virtualhost.inc/35owncloud-redirect. Contents are:

#
# 35owncloud-redirect
# Redirect requests for /owncloud/ to /nextcloud/
#

RewriteEngine on
RedirectMatch "^/owncloud/(.*)" "/nextcloud/$2"

(based on the Apache docs, section on Canonical URLs). It seems to work–if I browse to https://my_fqdn/owncloud, it redirects me to /nextcloud and gives me the login screen. Time to see if my clients will still work with their old configuration.