html - 基础href URL html5
问题描述
我有一个像www.site.com这样的网站,我在上面使用了以下语言:
https://www.example.com/en/dashboard.html
https://www.example.com/es/dashboard.html
https://www.example.com/fr/dashboard.html
https://www.example.com/de/dashboard.html
我正在使用一个基本的href url:
<base href="www.site.com/">
如果我调用 css 文件或 js 文件,例如:
<link rel="stylesheet" href="assets/css/bootstrap-4.5.0.min.css">
它给出了该文件不存在,当我检查源代码并单击该文件时,我遵循以下网址:
https://www.example.com/en/assets/css/bootstrap-4.5.0.min.css
但是文件位于根域下:
/home/site/www/assets/css/bootstrap-4.5.0.min.css
不是在所有语言下。
那么我可以调用这些文件以获得这样的 url,而无需语言代码:
https://www.example.com/assets/css/bootstrap-4.5.0.min.css
解决方案
推荐阅读
- reactjs - NextJS useEffect locaStorage 问题
- web-scraping - 如何从 scrapy 项目创建可执行文件?
- sql-server - 将 bcp 与取自另一列的文件名一起使用
- linux - API/CLI 触发 KVM 动作
- javascript - 使用ajax强制注销时数据库表未更新
- spring-boot - Navigator MediaDevices getUserMedia“权限被拒绝”
- macos - Mac OS X,Docker:将容器日志从 Docker for Mac VM 获取到同一 Docker for Mac 中的 ELK 堆栈
- python - 如何将索引应用到另一个数据帧的数据帧
- node.js - Aws lambda 返回承诺
- sql-server - SQL XPath 比较变量与空 XML 节点