I have found a well working .htaccess code on the internet that removed the .html extension and adds a trailing slash at the end of the URL.
However, when I link to a site in a subdirectory, it does not work, the subdirectory automatically gets erased in the URL, so the page is not loaded.
Here is my .htaccess code:
[CODE]
AddHandler application/x-httpd-php71 .php
AddDefaultCharset utf-8
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)/$ $1.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
I also have this same .htaccess in said subdirectory.
Does anybody have an idea how I can fix this issue?
Thanks for any help!