Compare commits
No commits in common. "6a6ecfd51ffdfd1572d26d12eee27abd1c971443" and "f3aaf89d2539427d879ae6b12de48e2dd0d64d43" have entirely different histories.
6a6ecfd51f
...
f3aaf89d25
@ -1,19 +0,0 @@
|
||||
<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>
|
||||
@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<!-- 规则 1: 将根路径请求重写到 start.html -->
|
||||
<!-- 这个规则匹配空路径 (根目录) -->
|
||||
<rule name="Rewrite root to start.html" stopProcessing="true">
|
||||
<match url="^$" />
|
||||
<action type="Rewrite" url="/start.html" />
|
||||
</rule>
|
||||
|
||||
<!-- 规则 2: 将所有其他未匹配的请求重写到 index.html (标准SPA规则) -->
|
||||
<!-- 这个规则匹配所有内容,但有条件限制 -->
|
||||
<rule name="Rewrite all others to index.html" stopProcessing="true">
|
||||
<match url=".*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<!-- 条件1: 请求的URL不是一个物理文件 -->
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<!-- 条件2: 请求的URL不是一个物理目录 -->
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="/index.html" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
Loading…
x
Reference in New Issue
Block a user