国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > 幫助中心 > 正文

vue下history模式刷新后404錯誤解決方法

2024-07-09 22:41:11
字體:
供稿:網(wǎng)友

本文介紹了vue下history模式刷新后404錯誤解決方法,分享給大家,具體如下:

官方說明文檔:

https://router.vuejs.org/zh/guide/essentials/history-mode.html

一、 實測 Linux 系統(tǒng) Apache 配置:

更改站點配置文件即可,我這里在 Directory 標簽后面添加了官方給的五行配置

<VirtualHost *:80>  #Created by linvic on 2018-05-24  Serveradmin 674206994@qq.com  ServerName blog.xxx.com  DocumentRoot /home/www/blog  <Directory "/home/www/blog">    Options FollowSymLinks    AllowOverride All    #Require all denied    Require all granted    RewriteEngine On        RewriteBase /    RewriteRule ^index/.html$ - [L]    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule . /index.html [L]       </Directory></VirtualHost>

二、 實測 Windows 環(huán)境下 IIS 配置

1. IIS安裝Url重寫功能

https://msdn.microsoft.com/zh-cn/gg192883.aspx

到該網(wǎng)站下載安裝web平臺安裝程序 安裝后打開到里面搜索安裝URL重寫功能

2. web.config

將web.config 文件放置于 npm run build 打包后文件的根目錄即可。

ps:此文件會自動給IIS上的URL重寫功能進行相關(guān)配置

文件內(nèi)容如下:

<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer>  <staticContent>   <remove fileExtension=".woff" />   <mimeMap fileExtension=".woff" mimeType="font/x-woff" />   <remove fileExtension=".woff2" />   <mimeMap fileExtension=".woff2" mimeType="font/x-woff2" />   <remove fileExtension=".ttf" />   <mimeMap fileExtension=".ttf" mimeType="font/x-ttf" />   <remove fileExtension=".json" />   <mimeMap fileExtension=".json" mimeType="text/json" />  </staticContent>  <rewrite>   <rules>    <rule name="vue" stopProcessing="true">     <match url=".*" />     <conditions logicalGrouping="MatchAll">      <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />     </conditions>     <action type="Rewrite" url="/" />    </rule>   </rules>  </rewrite> </system.webServer></configuration>

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持武林網(wǎng)之家。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 东山县| 崇文区| 顺平县| 南阳市| 宝兴县| 枣阳市| 饶河县| 梅州市| 独山县| 克东县| 鱼台县| 遵义市| 千阳县| 嘉峪关市| 岢岚县| 鄢陵县| 长汀县| 兴国县| 徐州市| 博乐市| 华亭县| 汨罗市| 梁山县| 容城县| 韶关市| 阜新市| 镇原县| 增城市| 和田县| 青阳县| 临沧市| 东乌珠穆沁旗| 中阳县| 汝城县| 昌都县| 勃利县| 湖口县| 上杭县| 锡林浩特市| 浦城县| 榆树市|