I have this snippet in .htaccess
that is working for my current need:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule . index.php [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I am building a PHP file that generates dynamic and accurate sitemap to add this line after RewriteEngine On
:
RewriteRule ^sitemap\.xml$ gera_xml.php [L]
The idea is that if I put www.site.com.br/sitemap.xml
, it displays the sitemap in XML, but it does not work at all.
I have already changed my position and nothing. I changed the statement and gave the page error.