解决宝塔部署vue项目时,访问首页正常,其他页面无法访问404 Max迪丶先生 2020-03-11 阅读1 分钟 2 如题,访问首页没问题,其他页面404.其实只要项目配置伪静态即可; 宝塔-》网站-》设置-》伪静态 location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.html?s=/$1 last; break; } } ...
https://admin.xxx.com/ 访问正常 https://admin.xxx.com/index 访问404 location /{ root/home/ruoyi/projects/ruoyi-ui; try_files $uri $uri/ /index.html; index index.html index.htm; } nginx 加上上面这段即可,表示不管哪个目录,都会访问根目录的index.html文件...