Options -Indexes -MultiViews
DirectoryIndex index.php

<IfModule mod_headers.c>
    Header set Cache-Control "public, max-age=0, must-revalidate"
    <FilesMatch "\.(css|js|webp|png|jpe?g|svg|woff2?)$">
        Header set Cache-Control "public, max-age=604800" "expr=%{QUERY_STRING} =~ /(^|&)v=[a-f0-9]{12}(&|$)/"
    </FilesMatch>
    Header set X-Content-Type-Options "nosniff"
</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>

RewriteEngine On
# Only the owner's production domain is normalized; Preview/local hosts remain untouched.
RewriteCond %{HTTP_HOST} ^www\.villa-nocturno\.hr(?::[0-9]+)?$ [NC]
RewriteRule ^ https://villa-nocturno.hr%{REQUEST_URI} [R=301,END,NE]
RewriteCond %{HTTP_HOST} ^villa-nocturno\.hr(?::[0-9]+)?$ [NC]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !^https$ [NC]
RewriteRule ^ https://villa-nocturno.hr%{REQUEST_URI} [R=301,END,NE]
RewriteRule ^router\.php$ - [R=404,END]
RewriteRule ^(?:sitemap\.xml|robots\.txt)$ index.php [END]

# Existing public assets are served directly; all other paths reach index.php.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [END]
RewriteRule ^ index.php [END]
