enuk

.htaccess


    ExpiresActive On
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType text/html "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
    

An overview about how to speed up your website you can test it at:
https://developers.google.com/speed/pagespeed/insights/

StackOverFlow

From dan.berladyn.online


    RewriteEngine On
    
    RewriteOptions inherit
    
    # 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 error_reporting E_ALL
       php_value error_log "/home/[user-account]/logs/php-errors.log"
    </IfModule>
    
    <IfModule lsapi_module>
       php_value error_reporting E_ALL
       php_value error_log "/home/[user-account]/logs/php-errors.log"
    </IfModule>
    
    # END cPanel-generated php ini directives, do not edit
    
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP:X-Forwarded-SSL} !on
    RewriteCond %{HTTP_HOST} ^berladyn.online$ [OR]
    RewriteCond %{HTTP_HOST} ^www.berladyn.online$
    RewriteRule ^/?$ "https://berladyn.online/" [R=301,L]
    RewriteCond %{HTTP_HOST} ^berladyn.online$ [OR]
    RewriteCond %{HTTP_HOST} ^www.berladyn.online$
    RewriteRule ^directory.php$ "https://berladyn.online/directory.php" [R=301,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
    

First check if mod rewrite is enabled on the server:


    <IfModule mod_rewrite.c>
    
    </IfModule>
    
RewriteEngine On
    RewriteCond %{REQUEST_URI}  !(\.png|\.jpg|\.webp|\.gif|\.jpeg|\.zip|\.css|\.svg|\.js|\.xml)$
    RewriteRule (.*) routes.php [QSA,L]
    
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
    </IfModule>
    
[www/directory/.htaccess]