Options -Indexes
RewriteEngine On
RewriteRule ^chat/(?:config|messages|start|send|contact|retry|privacy|telegram/webhook)/?$ chat.php [L]
RewriteRule ^(?:app|config|database|docs|storage|tests|tmp|tools)(?:/|$) - [F,L,NC]
RewriteRule ^\.(?!well-known/) - [F,L]
RewriteRule ^(?:router\.php|README\.md|.*\.(?:sql|log|ini|bak|env|ps1|py))$ - [F,L,NC]
RewriteRule ^(product|occasion|delivery|guides)/([a-z0-9]+(?:-[a-z0-9]+)*)/$ /$1/$2 [R=301,L,NE]
RewriteRule ^(guides|contacts|delivery)/$ /$1 [R=301,L,NE]
RewriteRule ^guides$ guide.php [QSA,L]
RewriteRule ^guides/([a-z0-9]+(?:-[a-z0-9]+)*)$ guide.php?slug=$1 [QSA,L,NC]
RewriteRule ^(contacts|delivery)$ info.php?page=$1 [QSA,L]
RewriteRule ^robots\.txt$ robots.php [L]
RewriteRule ^sitemap\.xml$ sitemap.php [L]
RewriteRule ^product/([a-z0-9]+(?:-[a-z0-9]+)*)/?$ product.php?slug=$1 [QSA,L,NC]
RewriteRule ^occasion/([a-z0-9]+(?:-[a-z0-9]+)*)/?$ occasion.php?slug=$1 [QSA,L,NC]
RewriteRule ^delivery/([a-z0-9]+(?:-[a-z0-9]+)*)/?$ delivery.php?slug=$1 [QSA,L,NC]
RewriteRule ^account(?:/(login|register|profile|orders|events|notifications|privacy))?/?$ account.php?section=$1 [QSA,L,NC]
RewriteRule ^appeal/?$ appeal.php [QSA,L,NC]
RewriteRule ^appeal-response/?$ appeal-response.php [QSA,L,NC]
DirectoryIndex index.php
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "same-origin"
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 day"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType text/css "access plus 1 day"
ExpiresByType application/javascript "access plus 1 day"
</IfModule>
