国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 民丰县| 甘谷县| 延庆县| 宁都县| 岳普湖县| 察哈| 沙洋县| 景宁| 彩票| 高平市| 荥经县| 忻城县| 永川市| 普格县| 新野县| 成安县| 大关县| 蛟河市| 保靖县| 大宁县| 杭锦旗| 凤山市| 景谷| 阳城县| 尉犁县| 延庆县| 册亨县| 科技| 达日县| 东乌| 泰宁县| 庄河市| 云林县| 庄河市| 阳山县| 宁夏| 建德市| 会同县| 兴业县| 祁门县| 安陆市|