# Elixir Skin Clinic - performance and safe defaults
Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^sitemap\.xml$ sitemap.php [L]
# Serve generated WebP variants to supported browsers without changing existing DB/file names.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} \.(?:jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} ^(.+)\.(?:jpe?g|png)$ [NC]
RewriteCond %1.webp -f
RewriteRule ^(.+)\.(?:jpe?g|png)$ $1.webp [T=image/webp,E=WEBP:1,L]
</IfModule>

<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_WEBP
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set X-Frame-Options "SAMEORIGIN"
<FilesMatch "\.(?:css|js|jpg|jpeg|png|gif|webp|svg|ico|woff2?)$">
Header set Cache-Control "public, max-age=2592000, stale-while-revalidate=86400"
</FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 30 days"
ExpiresByType application/javascript "access plus 30 days"
ExpiresByType image/webp "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/svg+xml "access plus 30 days"
ExpiresByType font/woff2 "access plus 1 year"
</IfModule>


# Prevent public access to deployment/update artifacts.
<FilesMatch "^(?:INSTALL-.*\.txt|.*\.zip|error_log)$">
Require all denied
</FilesMatch>

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