html - 资源未加载到网页上
问题描述
我编写了简单的 HTML 和 CSS 文件并将它们上传到我的服务器,但是这些 CSS 和 HTML 文件没有被正确读取。当我在本地测试它时它工作正常,但当我将它上传到我的服务器时它不起作用。
这是我的树:
.
|-- assets
| `-- icon.png
|-- index.html
|-- pages
| |-- about.html
| |-- certificates.html
| |-- programmingLanguages.html
| |-- projects.html
| `-- socials.html
`-- styles
|-- base_style.css
`-- indexpage.css
我试过“/styles/indexpage.css”、“./styles/indexpage.css”和“syles/indexpage.css”。我什至用“/var/www/suchcodes/styles/indexpage.css”尝试了绝对路径,但这些都不起作用......
请帮忙。网页:suchcodes.info
解决方案
可能在服务器上 .htaccess 正在更改请求的路径。您应该使用动态构建的路径,例如 url('/styles/indexpage.css') 转换为www.mysite.com/styles/indexpage.css
推荐阅读
- php - 在 MacOS Catalina 上使用 MAMP 在 codeigniter 4 中看不到我的控制器
- ios - UICollectionView:如何使用新的 iOS 13 API UICollectionViewDiffableDataSource & NSDiffableDataSourceSnapshot 进行分页集合?
- node.js - 如何在 node.js 中上传图像文件?
- sum - 如何计算当月的金额总和,包括 Power Bi 中前几个月的金额?
- clojure - 消除clojure中的依赖关系
- node.js - 如何避免在量角器中悬停?
- reactjs - 如何在 React Navigation 5 中全局应用应用程序背景颜色
- tensorflow - 我只需要等效于 cv2.threshold nad np.std 的 tensorflow 函数即可在 tensorflow 1.8 中使用
- angularjs - 有没有办法在angularJS中翻译成另一种语言的月份和日期名称?
- mysql - 这个使用 order by 和 left join 的 sql 查询有什么问题?这是正确的方法吗?