# Enterprise-CMS - Public directory rewrite rules (Nginx compatible via Laragon)
Options -Indexes
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # 上传目录禁止执行脚本
    RewriteRule ^uploads/.*\.(?i:php|phtml|phar|pl|py|cgi|sh|asp|aspx|jsp)$ - [F,L]

    # 真实存在的文件与目录直接输出
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # 所有其他请求交给 index.php 路由
    RewriteRule ^ index.php [L,QSA]
</IfModule>

<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpeg "access plus 30 days"
    ExpiresByType image/png "access plus 30 days"
    ExpiresByType image/webp "access plus 30 days"
    ExpiresByType text/css "access plus 7 days"
    ExpiresByType application/javascript "access plus 7 days"
</IfModule>

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

<IfModule mod_headers.c>
    Header append Vary Accept-Encoding env=!dont-vary
</IfModule>
