RewriteEngine On

# --------------------------
# Laravel URL 重写（所有请求转发到 index.php）
# --------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L,QSA]

# --------------------------
# 禁止访问隐藏文件（允许 .well-known）
# --------------------------
RewriteRule /\.well-known - [L]
RewriteRule /\. - [F,L]

# --------------------------
# 上传目录禁止执行 PHP
# --------------------------
<FilesMatch "^/Uploads/.*\.php$">
    Deny from all
</FilesMatch>

# --------------------------
# 静态资源长期缓存（30 天）
# --------------------------
<FilesMatch "\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$">
    ExpiresActive On
    ExpiresDefault "access plus 30 days"
    Header set Cache-Control "public, immutable"
</FilesMatch>
