kdofficial/public/.htaccess
2025-08-21 21:09:46 +08:00

19 lines
755 B
ApacheConf
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<IfModule mod_rewrite.c>
# 开启URL重写引擎
RewriteEngine On
# 规则 1: 处理根路径
# 当用户请求确切的根路径 (例如 http://yourdomain.com/) 时
# 内部重写到 start.html。
# ^$ 匹配空路径 (即根目录)。[L] 表示这是最后一条规则,如果匹配成功则停止处理。
RewriteRule ^$ /start.html [L]
# 规则 2: 处理其他所有路径 (标准的SPA规则)
# 在处理其他路径之前,先确保请求的不是一个真实存在的文件或目录。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 如果以上条件满足 (不是文件或目录)
# 则将请求重写到 index.html让Vue Router处理。
RewriteRule . /index.html [L]
</IfModule>