RewriteEngine On
RewriteBase /house-cleaning/

# Clean URL: /ypiresies/{slug}/ -> pages/service.php?slug={slug}
# Νέα σελίδα υπηρεσίας = ένα νέο αρχείο content/services/{slug}.php, καμία αλλαγή εδώ.
RewriteRule ^ypiresies/([a-z0-9-]+)/?$ pages/service.php?slug=$1 [L,QSA]

# Hub υπηρεσιών
RewriteRule ^ypiresies/?$ pages/ypiresies.php [L,QSA]

# Blog: λίστα, άρθρο, feed
RewriteRule ^blog/feed\.xml$ blog-feed.php [L]
RewriteRule ^blog/([a-z0-9-]+)/?$ pages/blog-post.php?slug=$1 [L,QSA]
RewriteRule ^blog/?$ pages/blog-index.php [L,QSA]

# Στατικές σελίδες
RewriteRule ^perioxes/?$ pages/perioxes.php [L,QSA]
RewriteRule ^sxetika/?$ pages/sxetika.php [L,QSA]
RewriteRule ^epikoinonia/?$ pages/epikoinonia.php [L,QSA]
RewriteRule ^politiki-aporritou/?$ pages/politiki-aporritou.php [L,QSA]
RewriteRule ^politiki-cookies/?$ pages/politiki-cookies.php [L,QSA]

# Δυναμικό sitemap / robots
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^robots\.txt$ robots.php [L]

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

# Cache headers για static assets (χρησιμοποιούν ?v= query string για cache-busting)
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/avif "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType video/mp4 "access plus 1 year"
  ExpiresByType font/woff2 "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>

# Security headers
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
  Header set Permissions-Policy "geolocation=(), microphone=(), camera=()"
</IfModule>

# 404
ErrorDocument 404 /house-cleaning/404.php
