RewriteEngine On
RewriteBase /tap2order/

RewriteCond %{DOCUMENT_ROOT}/tap2order/install/installed.lock !-f
RewriteCond %{REQUEST_URI} !^/tap2order/install/
RewriteRule ^(.*)$ /tap2order/install/ [R=302,L]

RewriteRule ^menu/([^/]+)/?$ menu.php?r=$1 [QSA,L]

RewriteRule ^uploads/.*\.(php|phtml|php3|php4|php5|pl|cgi|sh|sql)$ - [F,L]

<IfModule mod_headers.c>
    <FilesMatch "\.(jpg|jpeg|png|gif|webp|ico|svg)$">
        Header set Cache-Control "max-age=2592000, public"
    </FilesMatch>
    <FilesMatch "\.(css|js)$">
        Header set Cache-Control "max-age=86400, public"
    </FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/json
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>

ErrorDocument 404 /tap2order/error_pages/404.php
ErrorDocument 500 /tap2order/error_pages/500.php
ErrorDocument 403 /tap2order/error_pages/403.php

<FilesMatch "\.(env|log|ini|sql)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

<IfModule mod_rewrite.c>
    Options -MultiViews
</IfModule>
