Well-known URLs

Apache
To activate well-known URLs, you have to edit the apache config. To use the following snippets, you have to activate mod_rewrite.

Possibility a: redirect everything
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /caldav.php/$1 [NC,L]
 * 1) Activate RewriteEngine
 * 1) Filter all files that do not exist
 * 1) and redirect them to our caldav.php

Under Apache 2.3 and if you put that in your site configuration (same as httpd.conf) you should rather use that :

RewriteEngine On RewriteCond %{LA-U:REQUEST_FILENAME} !-f RewriteCond %{LA-U:REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /caldav.php/$1 [NC,L]
 * 1) Activate RewriteEngine
 * 1) Filter all files that do not exist
 * 1) and redirect them to our caldav.php

This configuration does not work together with other programs using mod_rewrite. As a side effect,

Possibility b: redirect .well-known only
RewriteEngine On RewriteRule ^/\.well-known/(.*)$ /caldav.php/.well-known/$1 [NC,L] RewriteRule ^/principals/users/(.*)$ /caldav.php/$1 [NC,L]
 * 1) Activate RewriteEngine
 * 1) Redirect /.well-known URLs
 * 1) Optionally: redirect /principals/users/ as well

This configuration does not include the forwards to calendars (/username/calendarname instead of /caldav.php/username/calendarname).