# Tparts.ge — Apache configuration
Options -Indexes -MultiViews
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    # Uncomment to force HTTPS and www once the SSL certificate is active:
    # RewriteCond %{HTTPS} !=on
    # RewriteRule ^ https://www.tparts.ge%{REQUEST_URI} [L,R=301]
    # RewriteCond %{HTTP_HOST} ^tparts\.ge$ [NC]
    # RewriteRule ^ https://www.tparts.ge%{REQUEST_URI} [L,R=301]

    # Block hidden files and private folders if they are ever placed here
    RewriteRule (^|/)\. - [F,L]
    RewriteRule ^tparts_app(/|$) - [F,L]

    # Everything that is not a real file goes to the front controller
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L,QSA]
</IfModule>

# Never serve these file types directly
<FilesMatch "\.(sql|log|ini|env|sh|bak|lock|json|md|xlsx|csv|zip|dist)$">
    Require all denied
</FilesMatch>
<FilesMatch "^(robots\.txt|manifest\.json)$">
    Require all granted
</FilesMatch>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/webp "access plus 30 days"
    ExpiresByType image/jpeg "access plus 30 days"
    ExpiresByType image/png "access plus 30 days"
    ExpiresByType font/woff2 "access plus 1 year"
    ExpiresByType text/css "access plus 30 days"
    ExpiresByType application/javascript "access plus 30 days"
    ExpiresByType text/javascript "access plus 30 days"
</IfModule>
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/javascript text/javascript application/json image/svg+xml text/xml application/xml
</IfModule>
<IfModule mod_mime.c>
    AddType font/woff2 .woff2
    AddType image/webp .webp
</IfModule>
