# Enable GZIP compression for text-based files
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/plain text/html text/css text/javascript application/javascript application/x-javascript application/xml application/xhtml+xml application/rss+xml application/atom+xml application/json application/x-webfont-eot application/x-webfont-ttf application/x-webfont-woff application/x-font-otf application/x-font-woff2 image/svg+xml image/x-icon
</IfModule>

# Leverage browser caching for static assets (change the times to your needs)
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>

# Set a far future expiration date for fonts
<FilesMatch "\.(woff|woff2|ttf|otf)$">
  Header set Cache-Control "max-age=31536000, public"
</FilesMatch>

# Enable ETag headers
FileETag MTime Size

# Remove query strings from static resources
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{QUERY_STRING} !^$
  RewriteCond %{REQUEST_URI} ^(.+)\.(css|js|png|jpg|gif)$
  RewriteRule ^(.*)$ $1? [R=301,L]
</IfModule>

# Disable directory listing
Options -Indexes

# Block access to sensitive files and directories
<FilesMatch "(^\.|wp-config\.php|php\.ini|php\.info|readme\.html|license\.txt)">
  Order allow,deny
  Deny from all
</FilesMatch>

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

# PHP 7 configuration
<IfModule php7_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 128M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php74"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression On
</IfModule>

# PHP 5 configuration
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 32M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression On
</IfModule>

# LiteSpeed configuration (for both PHP 7 and PHP 5)
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 128M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php74"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression On
</IfModule>

# END cPanel-generated php ini directives, do not edit

# Redirect requests to remove .php extension
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^([^\.]+)$ $1.php [NC,L]
  # To remove the .php extension from links generated by PHP scripts
  RewriteCond %{THE_REQUEST} \s/+(.*?/)?(?:index)?(.*?)\.php[\s?/] [NC]
  RewriteRule ^ /%1%2 [R=301,L,NE]
</IfModule>

RewriteEngine On
RewriteRule ^$ /home.php [L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
