惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - 星畔

解决网站访问突然变成“403禁止访问:访问被拒绝” 解决openclaw + 飞书群不@所有人,群里其他人不回复的问题 针对 WSL 环境的特殊处理(如果你用的是 Windows 子系统) wsl 删除ubuntu-24.04 ASP.NET Core Web API 需要先发布到 IIS 服务器才能运行 使用 .NET Core。如果目标进程未运行 .NET Core,则发生这种情况并不意外。 因 Cookie 被添加了 SameSite=None 属性导致在非 https 环境下无法为网站正确设置 Cookie 进而导致系统状态异常的问 完美解决:没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限。 - 星畔 Windows10 IIS Web服务器安装配置 解决“远程桌面连接:出现身份验证错误,要求的函数不受支持。。。 ” elasticsearch 请求被中止: 未能创建 SSL/TLS 安全通道”的原因及解决办法 从 bcp 客户端收到一个对 colid x 无效的列长度。 log4j的配置ConversionPattern详细讲解 SQL 更改字段长度 SQL Server(00):表压缩 Vue网站发布到iis后提示404页面不可访问 mysql根据一个表的数据更新另一个表数据的SQL写法 C#中四舍五入的正确写法是什么?
window 站点 vue3编译后的项目刷新页面404解决办法
星畔 · 2025-11-10 · via 博客园 - 星畔

Vue3项目在Windows llS服务器上部署后刷新页面出现404错误,这是因为Vue Router使用了
HTML5 History模式 2 3。当直接访问或刷新子路由时,IIS会尝试寻找对应的物理文件或目录,但
Vue作为单页面应用(SPA)实际上只有一个 index.html 入口。
解决方案
方法一:配置IIS URL重写(推荐)
这是最彻底的解决方案,需要在IIS中配置URL重写规则:
1.安装URL重写模块:首先确保服务器已安装IIS URL重写模块 4
2.创建web.conhg文件:在项目根目录创建 web.config 文件,添加以下配置:

<rewrite>
日 web.config 5
6
<rules><!--核心规则:匹配,所有非文件和非目录的请求,重写到index.html --><rule name="Vue Router SPA" stopProcessing="true">
7
8
9
<match url=".*”/><conditions logicalGrouping="MatchAll">
20双22B好崧昪梃狻1516I崧7281920212223改2627
<add input="{REQUEST FILENAME}" matchType="IsFile" negate="true" /><add input="{REOUEST FILENAME}" matchType="IsDirectory" negate="true” />
</conditions>
<action type-"Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
<!--处理静态资源,设置正确的MIME类型-->
<staticContent>
<mimeMap fileExtension=".js" mimeType-"application/javascript" /><mimeMap fileExtension=".css" mimeType="text/css" /><mimeMap fileExtension=".json" mimeType="application/json" />
</staticcontent>
</system.webServer></configuration>
28<code end>
此配置通过IIS的URL重写模块,将所有非真实文件或目录的请求重定向到`index,htm1`,中前端vue Router接管路由设