SetEnv ALLOW_OVERWRITE On
SetEnv HTTP_MOD_GZIP Off

# You can define various environments and load the correponding config files:
# If not set, application/config/config.php
# application/config/development/config.php
# application/config/testing/config.php
# application/config/production/config.php
#SetEnvIf Host localhost CI_ENV=development
#SetEnvIf Host localhost CI_ENV=testing
#SetEnvIf Host localhost CI_ENV=production

<IfModule mod_rewrite.c>
    Options +FollowSymLinks

    RewriteEngine On
    # Tell PHP that the mod_rewrite module is ENABLED.
    SetEnv HTTP_MOD_REWRITE On

    # Example showing how to force HTTPS
    #RewriteCond %{HTTPS} !=on
    #RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,QSA,L,NE]

    #Remove index.php from URL
    RewriteCond $1 !^(index\.php|(.*)\.images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
</IfModule>
 
<IfModule !mod_rewrite.c> 
    # Without mod_rewrite, route 404's to the front controller
    SetEnv HTTP_MOD_REWRITE Off
    ErrorDocument 404 "Error : Module rewrite is not available. Please check your system with requirements.php"
 </IfModule>

<IfModule mod_headers.c>
    <FilesMatch "\.(php|xls|xlsx)$">
        Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform, must-revalidate"
        Header set Pragma "no-cache"
    </FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
    SetEnv HTTP_MOD_GZIP On
</IfModule>
<IfModule !mod_headers.c>
    #On WAMP, Deflate module needs mod_headers, otherwise it cause an error 500
    SetEnv HTTP_MOD_GZIP Off
</IfModule>

<IfModule mod_headers.c>
    <IfModule mod_deflate.c>
        <IfModule mod_filter.c>
            SetOutputFilter DEFLATE
            AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
        </IfModule>
    </IfModule>
</IfModule>

<ifModule mod_gzip.c>
    #Enable compression if available
    SetEnv HTTP_MOD_GZIP On
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

# 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)
<IfModule php7_module>
   php_value date.timezone "Asia/Kuala_Lumpur"
   php_flag display_errors On
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 200M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
   php_value upload_max_filesize 200M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_value date.timezone "Asia/Kuala_Lumpur"
   php_flag display_errors On
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 200M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
   php_value upload_max_filesize 200M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

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