I try to redirect the index.php plus system pages such as 404.php, 403.php etc. to their respective .html pages (index.html, 404.html, 403.html etc.) in the ROOT directory.
The problem is that the suggested solutions provided on Stackoverflow don’t seem to work in my case. Due to technical requirements, the PHP files have to stay in the root directory.
Rules in .htaccess
RewriteOptions inherit
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin *
</IfModule>
#Header set Access-Control-Allow-Origin *