RewriteEngine On
RewriteBase /

# Internally serve .html when clean URL is used
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)/?$ $1.html [L]

# Redirect .html URL to clean version
RewriteCond %{THE_REQUEST} "^[A-Z]{3,}\s/([^\s]+)\.html" [NC]
RewriteRule ^ /%1 [R=301,L]

# Remove index.html from URL
RewriteCond %{THE_REQUEST} /index\.html [NC]
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]


# PHP Limits for uploads and scripts
<IfModule mod_php7.c>
  php_value upload_max_filesize 512M
  php_value post_max_size 512M
  php_value memory_limit 512M
  php_value max_execution_time 300
  php_value max_input_time 300
</IfModule>

<IfModule mod_php8.c>
  php_value upload_max_filesize 512M
  php_value post_max_size 512M
  php_value memory_limit 512M
  php_value max_execution_time 300
  php_value max_input_time 300
</IfModule>
