# [Production] .htaccess
# 开启重写引擎
RewriteEngine On
RewriteBase /

# 1. 允许编码后的斜杠 (关键：解决 URL 参数中包含 / 的问题)
#<IfModule mod_rewrite.c>
#    Options +FollowSymLinks
#</IfModule>

# 2. 静态资源直通 (JS/CSS/图片/字体 不走 PHP，除非原本就是 404)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# 3. 拦截 /https://... 或 /http://... 形式的路径
# capturing group $1 = protocol (https), $2 = rest of url
# NE (No Escape) 确保 URL 不会被二次转义
RewriteRule ^(https?):/(.*)$ index.php?path_proxy=$1://$2 [L,QSA,NE]

# 4. 兜底规则
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]