IIS URLRewrite vue单页应用程序(history模式)
vue的单页应用部署后,当我们进入到某个路由之后,按F5刷新页面会出现404错误:
IIS下部署后的解决方案一般是使用 URLRewrite
首先要安装URLRewrite 下载地址
最开始的时候安装了URLRewrite,
现在在IIS上添加重写规则
![](http://upload-images.jianshu.io/upload_images/4342827-bec415c60244dedb.png?imageMogr2/auto-orient/strip|imageView2/2/w/425/format/webp)
image.png
这一步后,选择右上角的添加规则
![](http://upload-images.jianshu.io/upload_images/4342827-7202a07b01cb4e80.png?imageMogr2/auto-orient/strip|imageView2/2/w/844/format/webp)
image.png
![](http://upload-images.jianshu.io/upload_images/4342827-4f6e447bdc25ca7b.png?imageMogr2/auto-orient/strip|imageView2/2/w/752/format/webp)
image.png
![](http://upload-images.jianshu.io/upload_images/4342827-23c9bc5745409ccd.png?imageMogr2/auto-orient/strip|imageView2/2/w/754/format/webp)
image.png
![](http://upload-images.jianshu.io/upload_images/4342827-2ade45a9311070e1.png?imageMogr2/auto-orient/strip|imageView2/2/w/718/format/webp)
image.png
填写完毕后,点击右侧的应用即可
现在在
http://localhost:8088/about
路由下F5刷新就不会404了经测试问题解决!
世界再大也有尽头!