URL rewrite webdav in apache from *.com/remote.php/dav/files/username to domain.com/

Good morning all,

Is there a way to use a rewrite rule for Apache to change the URL for nextcloud WebDAV access from,

https;//some-domain-name.com/remote.php/dav/files/usernamr-goes-here

To

https;//some-domain-name.com

There are already “pretty” urls to make the total url shorter:
https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#pretty-urls

A subdomain could be perhaps easier, because if you rewrite, you will have to be careful not to rewrite several times, or not to rewrite when the correct URL is already used … And the problem is that internally the links created should also respect the new naming scheme. With the pretty urls this is done, not sure how much work it would be to do them even prettier :nail_care:

1 Like

I mean, yeah, the HTTP handling from URL to URL is easy enough but you’ll completely break your NC installation.

So the real answer is “No, you can’t do that because there are a lot of interactions you’re not taking into account.”

Let’s back up though: what’s the underlying problem you’re trying to solve by proposing this?