当前位置:网站首页>uniapp访问的路径去掉 # ,访问出现404
uniapp访问的路径去掉 # ,访问出现404
2022-07-21 05:22:00 【张泓锐】
一、我是在腾讯云服务器操作的
首先要把你的Apache服务器配置成https的
配置教程:https://cloud.tencent.com/document/product/400/35243
二、官方文档介绍的内容,要在uniapp的配置中设置history
三、官方文档还要配置服务器,但是不好使
根据uniapp、Apache服务器运行的原理,你会发现你在刷新的时候它会从你的根目录(一般情况下是/var/www/html/),也就是访问域名的时候跳转到index.html的那个目录,也可以理解成你访问域名的目录,但是你刷新的路径后面加了”pages/demo/demo“,然后服务器发现在index.html那个目录下面根本没有”pages/demo/demo“这个目录,所以会报404。所以这时候,你就需要给服务器设置一个404的页面,当访问内容错误的时候 自动跳转到你设置的404页面。
首先我们打开Apache的配置文件httpd.conf,然后找到下面这部分,
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
边栏推荐
- Deploy lvs-nat cluster
- Detailed explanation of iptables
- The communication process and principle of peer-to-peer host are very simple
- DataX环境部署以及测试案例
- Top and ifconfig commands
- First root, middle root, and last root traversal of binary tree
- Summary of tcp/ip five layer and seven layer models (it is recommended to recite the full text)
- Part 03: SQL syntax tree parsing
- 奇怪的响应数据
- R5为ISP,只能进行IP地址配置,其所有地址均配为共有IP地址
猜你喜欢
[1260. 2D grid migration]
DNS域名解析
table表格
First root, middle root, and last root traversal of binary tree
lvm和磁盘配额
@Solution to the problem that the parameters in Hump format in the requestbody annotation transfer object cannot receive data
DataX环境部署以及测试案例
Zabbx6.0(生产实战)
tried to access field com. mysql. cj. CharsetMapping. COLLATION_ INDEX_ TO_ COLLATION_ NAME from class io. de
Part 03: SQL syntax tree parsing
随机推荐
The organization mode of the process: link mode and index mode
I spent 6000 to sign up for the test training class. Three months later, I successfully "cheated" into Tencent with a monthly salary of 17k
反向代理HAproxy
项目实施用到的一些命令
Zabbx6.0(生产实战)
form表单标签
First root, middle root, and last root traversal of binary tree
Jasperreports configures Chinese Fonts
How important is the instant debit system to B2B e-commerce business?
How are web interface resources saved?
Four stages of writing C language
2022-07-20 study notes of group 5 self-cultivation class (every day)
CDH5安装Kerberos认证
Configure server development environment under virtual machine
kettle入门之文本文件导入数据库
The creation of a process (creating primitives and the events that cause them to occur)
The actual case of Cisco configuring single arm routing is very simple
Spark相关常见问题汇总
Installation and implementation of zabbix5.0
2787:算24