【发布时间】:2015-10-14 06:04:42
【问题描述】:
我遇到了一个奇怪的问题。我是一个 php 初学者,我所有的 php 文件链接、图像源、样式表都指向 Https,即使在代码中它的 http。我的网页在 Firefox 中运行良好,但我在 Chrome 中遇到了这个问题。 例子 当我在 chrome 中查看页面源代码时,我得到了这个代码
<link rel='stylesheet' id='jshop-style-css' href='https://localhost:8080/wordpress/wp-content/themes/jshop/style.css?ver=4.2.3' type='text/css' media='all' />
而在 Firefox 中我得到了
<link rel='stylesheet' id='jshop-style-css' href='http://localhost:8080/wordpress/wp-content/themes/jshop/style.css?ver=4.2.3' type='text/css' media='all' />
我在 Xampp 上运行我的应用程序。谁能帮助我为什么我在 Chrome 中遇到这个问题?
【问题讨论】:
-
您的原始 sn-ps 在您编辑之前显示了问题的根源。
href="//example.com/some/path/and/file.css自动解析为您当前使用的任何协议。因此,如果某些内容从 http 重定向到 https,那么这些 css 资产也将来自 https。
标签: php wordpress http https xampp