# Apache/Hostinger hardening for a static website.
Options -Indexes

# Clean URLs: /about, /products, /quality, /gallery, /contact
# Keep the actual PHP files hidden behind these extensionless URLs.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^about/?$ about.php [L]
RewriteRule ^products/?$ products.php [L]
RewriteRule ^quality/?$ quality.php [L]
RewriteRule ^gallery/?$ gallery.php [L]
RewriteRule ^contact/?$ contact.php [L]

# Prevent hotlinking of common image assets from other sites.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?shriramchuramil\.com [NC]
RewriteRule \.(?:jpg|jpeg|png|gif|webp|svg)$ - [F,NC,L]

# Prevent access to common project/source files that should never be public.
<FilesMatch "^(README\.txt|.*\.bak|.*\.log|.*\.env|composer\.(json|lock)|package(-lock)?\.json)$">
  Require all denied
</FilesMatch>
