RewriteEngine On
RewriteBase /

# Deny access to .env files
<FilesMatch "\.env$">
  Order allow,deny
  Deny from all
</FilesMatch>

# Deny access to .sqlite files
<FilesMatch "\.(sqlite|db)$">
  Order allow,deny
  Deny from all
</FilesMatch>

# Route sitemap requests to sitemap.php
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^sitemap-([a-z]+)\.xml$ sitemap.php [L]
RewriteRule ^sitemap-([a-z]+)-([0-9]+)\.xml$ sitemap.php [L]

# Exclude existing files and directories from rewriting

# Rewrite all other URLs to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,QSA]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php83” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
