.htaccess file Your data directory and files are probably accessible from the internet. The .htaccess file is not working

I’ve search the forum and tried multiple solutions and nothing seems to work. I have one site enabled in the sites-enabled. My config.php looks like below


<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxx',
  'passwordsalt' => 'xxxxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' => 
  array (
    1 => '*.*.*.*',
    2 => 'https://xxxxx.yyyyyyy.com/',
    3 => 'xxxxx.yyyyyyy.com',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.1.1',
  'overwrite.cli.url' => 'https://xxxxx.yyyyyyy.com/',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'cccccc',
  'dbhost' => 'xxx.xxx.xxx.xxx',
  'dbport' => 'hhhh',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'llllll',
  'dbpassword' => 'hhhhhhh',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'app_install_overwrite' => 
  array (
    0 => 'memories',
  ),
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'enable_previews' => true,
  'preview_max_filesize_image' => 999,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\Image',
    7 => 'OC\\Preview\\Photoshop',
    8 => 'OC\\Preview\\TIFF',
    9 => 'OC\\Preview\\SVG',
    10 => 'OC\\Preview\\Font',
    11 => 'OC\\Preview\\MP3',
    12 => 'OC\\Preview\\Movie',
    13 => 'OC\\Preview\\MKV',
    14 => 'OC\\Preview\\MP4',
    15 => 'OC\\Preview\\AVI',
  ),
  'memories.exiftool' => '/var/www/html/nextcloud/apps/memories/bin-ext/exiftool-amd64-glibc',
  'memories.vod.path' => '/var/www/html/nextcloud/apps/memories/bin-ext/go-vod-amd64',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'memories.vod.disable' => false,
  'memories.vod.nvenc' => true,
  'memories.vod.nvenc.temporal_aq' => true,
  'maintenance' => false,
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
);




apache2 folder sites-available has 1 site and it is:

<VirtualHost *:443>
ServerName xxxxx.yyyyyyy.com
ServerAlias xxxxx.yyyyyyy.com
DocumentRoot /var/www/html/nextcloud
    SSLEngine on
    
    SSLCertificateFile /******
    SSLCertificateKeyFile /*******


<Directory /var/www/html/>
 Require all granted
 Options FollowSymlinks MultiViews
 AllowOverride All
 Order allow,deny
 Allow from all

 <IfModule mod_dav.c>
#  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
  Dav off
 </IfModule>


SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud

</Directory>
</VirtualHost>




apache2.conf
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/html/nextcloud/>
	Options Indexes FollowSymLinks
	AllowOverride All
	Require all granted
</Directory>

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess



Any ideas? Is it having a problem with the .htaccess file or is it just telling me to get my data directory out of nextcloud folder?