RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.html [QSA,L]

# Enable caching
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 week"
</IfModule>

# Cache-Control for more granular control
<IfModule mod_headers.c>
  <FilesMatch "\.(jpg|jpeg|png|gif|ico|css|js|woff|woff2|svg|mp4|ttf)$">
    Header set Cache-Control "public"
  </FilesMatch>

  <FilesMatch "\.(html|htm|php)$">
    Header set Cache-Control "private, must-revalidate"
  </FilesMatch>
</IfModule>

# ETag configuration
<IfModule mod_headers.c>
  Header unset ETag
  FileETag None
</IfModule>

# Set Last-Modified header
<IfModule mod_headers.c>
  <FilesMatch "\.(html|htm|php)$">
    Header set Last-Modified "now"
  </FilesMatch>
</IfModule>
