# Nextcloud install adds a server-wide .well-known Cal/CardDAV redirect that breaks other vhosts

**URL:** <https://dietpi.com/forum/t/nextcloud-install-adds-a-server-wide-well-known-cal-carddav-redirect-that-breaks-other-vhosts/25499>\
**Category:** Troubleshooting\
**Created:** [20 September 2026 18:34 UTC](https://dietpi.com/forum/t/nextcloud-install-adds-a-server-wide-well-known-cal-carddav-redirect-that-breaks-other-vhosts/25499 "2026-09-20T18:34:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkoevesdi](https://dietpi.com/forum/user_avatar/dietpi.com/pkoevesdi/32/2051_2.png) [@pkoevesdi](https://dietpi.com/forum/u/pkoevesdi)\
**Post date:** [20 September 2026 18:34 UTC](https://dietpi.com/forum/t/nextcloud-install-adds-a-server-wide-well-known-cal-carddav-redirect-that-breaks-other-vhosts/25499/1 "2026-09-20T18:34:12Z")

</div>

### Required Information

- DietPi version: v10.7.2 (master)
- Distro version: Debian GNU/Linux 13 (trixie)
- Kernel version: 6.18.45-current-rockchip64, aarch64
- SBC model: ROCK 4 (aarch64)
- Webserver: Apache/2.4.68 (Debian)
- Additional software: Nextcloud 34.0.4

### What did I expect

Installing Nextcloud should configure the Cal/CardDAV `.well-known` redirects for the  
Nextcloud site only, and leave other virtual hosts on the same server untouched.

### What happened

`dietpi-software` writes the redirects into a **server-wide** Apache snippet and enables it  
globally (dietpi-software, lines 4786-4789):

```
# Cal/CardDAV redirects to Nextcloud DAV endpoint
echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint
Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2/conf-available/dietpi-dav_redirect.conf || exit 1
G_EXEC a2enconf dietpi-dav_redirect

```

Because `conf-enabled` applies to every virtual host, this has three effects:

1. **It affects unrelated vhosts.** On my server a Radicale vhost (`carddav.example.org`,  
separate `ServerName`, nothing to do with Nextcloud) had its own `.well-known` discovery  
redirected into the Nextcloud path. After disabling the snippet, Radicale answers its own  
discovery again.

2. **The target path only fits DietPi’s subdirectory install.** Anyone running Nextcloud from  
the document root of an own vhost gets a redirect to a path that does not exist. Nextcloud’s  
own setup check reports it:

3. **It is redundant for Nextcloud itself.** Nextcloud’s shipped `.htaccess` already contains  
the equivalent rewrite rules for `/.well-known/carddav` and `/.well-known/caldav`.

### Suggestion

Move the redirects from the global `conf-available` snippet into the Nextcloud site  
configuration (`dietpi-nextcloud.conf`), so they apply to the Nextcloud vhost only. The lighttpd  
(lines 4806-4812) and nginx (lines 4829-4832) branches use the same global approach, as does the  
Baikal installation (lines 8160-8163, 8169-8175, 8182-8184).

### Workaround

```
a2disconf dietpi-dav_redirect
systemctl reload apache2

```

and put the redirects into the vhost that serves Nextcloud:

```
Redirect 301 /.well-known/carddav /remote.php/dav
Redirect 301 /.well-known/caldav /remote.php/dav

```

A vhost-level `Redirect` takes precedence over the global one — I verified this by re-enabling  
the snippet temporarily — so a later re-install that runs `a2enconf` again does not undo the fix.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [21 September 2026 07:05 UTC](https://dietpi.com/forum/t/nextcloud-install-adds-a-server-wide-well-known-cal-carddav-redirect-that-breaks-other-vhosts/25499/2 "2026-09-21T07:05:49Z")

</div>

we will have a look  
ping @MichaIng

---

<div class="post-metadata">

**Author:** ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)\
**Post date:** [21 September 2026 11:52 UTC](https://dietpi.com/forum/t/nextcloud-install-adds-a-server-wide-well-known-cal-carddav-redirect-that-breaks-other-vhosts/25499/3 "2026-09-21T11:52:52Z")

</div>

You’re right, that should be going only to the vhost(s) we are managing, i.e. the default port 80 and 443 if enabled.
