網(wǎng)站首頁 編程語言 正文
h5 uniapp history模式下刷新頁面404
問題:uniapp 的history 把#去掉了,但是當刷新頁面的時候出現(xiàn)404 解決方案 需要服務(wù)端支持
如果 URL 匹配不到任何靜態(tài)資源,則應(yīng)該返回同一個 index.html 頁面
Apache:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
nginx
location / {
try_files $uri $uri/ /index.html;
}
原文鏈接:https://blog.csdn.net/zz975896590/article/details/119991104
相關(guān)推薦
- 2022-10-18 C/C++函數(shù)指針深入探究_C 語言
- 2022-04-17 Bootstrap typeahead自動補全插件的坑
- 2022-04-25 Python如何生成exe文件?用Pycharm一步步帶你學(xué)(超詳細、超貼心)_python
- 2022-09-26 css外邊距問題和顯示模式
- 2022-12-09 python反射機制內(nèi)置函數(shù)及場景構(gòu)造詳解_python
- 2022-06-24 python學(xué)習(xí)之讀取配置文件_python
- 2022-12-06 Python基礎(chǔ)globlal?nonlocal和閉包函數(shù)裝飾器語法糖_python
- 2022-07-26 Python使用psutil獲取系統(tǒng)信息_python
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支