# Caresoft Imaging — Apache. See INSTALL.md for the IIS web.config equivalent.
Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Canonical machine-readable endpoints
  RewriteRule ^sitemap\.xml$  sitemap.xml.php  [L]
  RewriteRule ^robots\.txt$   robots.txt.php   [L]
  RewriteRule ^llms\.txt$     llms.txt.php     [L]

  # Clean URLs for public content
  RewriteRule ^blog/?$                        blog.php            [L,QSA]
  RewriteRule ^blog/category/([a-z0-9-]+)/?$  blog.php?c=$1       [L,QSA]
  RewriteRule ^blog/([a-z0-9-]+)/?$           post.php?s=$1       [L,QSA]
  RewriteRule ^locations/([a-z0-9-]+)/?$      location.php?s=$1   [L,QSA]
  RewriteRule ^p/([a-z0-9-]+)/?$              page.php?s=$1       [L,QSA]
  RewriteRule ^demo/?$                        contact.php         [L,QSA]
</IfModule>

<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# Never serve config or logs
<FilesMatch "^(config\.php|.*\.log|.*\.sql)$">
  Require all denied
</FilesMatch>
