在iis中解决vue3的VUE History模式下项目刷新后或者直接跳转地址出现404的问题

参考 资料 https://blog.csdn.net/qq_38425048/article/details/137628970

第一步 下载iis的urlrewrite 并安装
第二步 如果是静态网站,将webconfig文件,放到网站根目录并重启。

注意。如果是netcore网站,请按上面的文章手动设置iis重写规则,或者将webconfig文件的内容添加到原有的文件中,最好不要直接覆盖。

另外 ngnix的设置方式 参考 https://cloud.tencent.com/developer/article/1470946

官网推荐
location / {
  root D:\Test\exprice\dist;
  index index.html index.htm;
  try_files $uri $uri/ /index.html;
}
匹配错误页
location /{
  root /data/nginx/html;
  index index.html index.htm;
  error_page 404 /index.html;
}

用到的文件 https://files.cnblogs.com/files/wang2650/iisrewrite.zip?t=1747742643&download=true

posted @ 2025-05-20 20:05  过错  阅读(10)  评论(0)    收藏  举报