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

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - 星畔

解决网站访问突然变成“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接管路由设