/.well-known/caldav and /.well-known/carddav Setup Error

Nextcloud version : 25.0.3
Operating system and version CentOS 7
Apache or nginx version (eg, Apache 2.4.25): Apache version??
PHP version : 7.4

I am on shared hosting, I am getting the errors relating to caldav and carddav eg:
Your web server is not properly set up to resolve "/.well-known/caldav".
My Nextcloud instance is not in a subfolder of the URL
The entries in the .htaccess file looks fine to me.

RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]

But I still have the error. I have looked through a good many of the forum posts, but I cannot find out how to resolve this.
I cannot edit the Apache config file because I am on shared hosting.

Steps to replicate it:

  1. On the page settings/admin/overview the error is reported as:
Your web server is not properly set up to resolve "/.well-known/caldav".
Your web server is not properly set up to resolve "/.well-known/carddav".

The output of your Nextcloud log in Admin > Logging:

No errors in log

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'example.com',
  ),
  'datadirectory' => '/home/me/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '25.0.3.2',
  'overwrite.cli.url' => 'https://example.com',
  'dbname' => 'clouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'clouddb_user',
  'dbpassword' => '',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '',
  'mail_from_address' => '',
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'mail_smtphost' => '',
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpport' => '465',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'default_phone_region' => '',
);

The output of your Apache/nginx/system log in /var/log/____:

Nothing relevant

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Nothing relevant