網(wǎng)站首頁 編程語言 正文
h5 uniapp history模式下刷新頁面404
問題:uniapp 的history 把#去掉了,但是當刷新頁面的時候出現(xiàn)404 解決方案 需要服務端支持
如果 URL 匹配不到任何靜態(tài)資源,則應該返回同一個 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
相關推薦
- 2022-12-12 flutter自定義InheritedProvider實現(xiàn)狀態(tài)管理詳解_Android
- 2022-07-03 C#并行編程之PLINQ(并行LINQ)_C#教程
- 2022-10-31 .Net中的Http請求調(diào)用詳解(Post與Get)_實用技巧
- 2022-06-21 C++簡明分析臨時對象是什么_C 語言
- 2023-07-10 String.format()格式化輸出
- 2022-07-14 C++深入探索類和對象之封裝及class與struct的區(qū)別_C 語言
- 2024-03-01 【Promise】promise關鍵問題和解決辦法
- 2022-07-06 Qt之使用GraphicsView框架實現(xiàn)思維導圖的示例_C 語言
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細win安裝深度學習環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結構-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支