网站丢失样式 请问怎么解决

2017-02-28 12:30:20 +08:00
 yesorno

学习建站 在阿里云上买了一个共享虚拟主机,域名申请了阿里的免费版证书,做了 CDN 。( www 和顶级域名都做了 cdn )上传了 wordpress 后,打开站点发现格式丢失,删除整个根目录后重新上传问题依旧,请帮忙分析一下,谢谢。 http://i.imgur.com/FTISwW8.png

4780 次点击
所在节点    问与答
20 条回复
Hello1995
2017-02-28 12:39:14 +08:00
按 F12 , Network 看各请求的状态…
yesorno
2017-02-28 12:44:25 +08:00
@Hello1995
Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure stylesheet 'http://abc.com/wp-includes/css/buttons.min.css?ver=4.7.2'. This request has been blocked; the content must be served over HTTPS.
setup-config.php:9 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure stylesheet 'http://abc.com/wp-admin/css/install.min.css?ver=4.7.2'. This request has been blocked; the content must be served over HTTPS.
setup-config.php:1 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure script 'http://abc.com/wp-includes/js/jquery/jquery.js?ver=1.12.4'. This request has been blocked; the content must be served over HTTPS.
setup-config.php:1 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure script 'http://abc.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'. This request has been blocked; the content must be served over HTTPS.
setup-config.php:1 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure script 'http://abc.com/wp-admin/js/language-chooser.min.js?ver=4.7.2'. This request has been blocked; the content must be served over HTTPS.
setup-config.php:1 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure favicon 'http://abc.com/favicon.ico/wp-admin/setup-config.php'. This content should also be served over HTTPS.
/favicon.ico/wp-admin/setup-config.php Failed to load resource: the server responded with a status of 500 ()
setup-config.php:1 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure stylesheet 'http://abc.com/wp-includes/css/buttons.min.css?ver=4.7.2'. This request has been blocked; the content must be served over HTTPS.
setup-config.php:1 Mixed Content: The page at 'https://abc.com/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure stylesheet 'http://abc.com/wp-admin/css/install.min.css?ver=4.7.2'. This request has been blocked; the content must be served over HTTPS.
yesorno
2017-02-28 12:44:44 +08:00
@Hello1995 能帮我看看是什么意思吗
ss098
2017-02-28 12:59:12 +08:00
你的这样些样式仍然是 http 请求,你要替换为 https 。
yesorno
2017-02-28 13:00:13 +08:00
@ss098 这个应该是在 wordpress 里面调整还是在哪儿呢
lecher
2017-02-28 13:00:20 +08:00
https 主域下面,因为安全原因,不能加载非 https 的资源,所以 http 的请求全都被拦截了。
解决办法就是把所有的静态资源都换成 https 的加密域
yesorno
2017-02-28 13:04:01 +08:00
@lecher 这个难不难呢?
lslqtz
2017-02-28 13:11:45 +08:00
动不动 https …醉了
yesorno
2017-02-28 13:18:30 +08:00
@lslqtz 因为看到网上说这是趋势 所以想一开始的时候就弄好 免得之后再做就更麻烦了
lgpqdwjh
2017-02-28 14:21:40 +08:00
楼上已有正解, wordpress 需要到数据库里执行几条 sql
PangCi
2017-02-28 14:46:17 +08:00
还是先把基础学好了,你这样直接搞不仅浪费时间还增加学习成本
maijiawei
2017-02-28 14:49:54 +08:00
别动不动就 https ,先把基础学好了
qiayue
2017-02-28 14:59:07 +08:00
如果你不懂的话,最笨的办法就是,每张表的每行记录看一下如果有 http:// 就替换成 https://
耿崇明一点办法是通过 sql 批量替换
irainsoft
2017-02-28 15:40:53 +08:00
简单一点用.htaccess 文件 301 跳转到 https 吧 wp 后台也应该有站点网址设置的
百度 关键词 wordpress https 对小白的教程大把大把,不如先看一个,这种基础的问题再单独出来问反而是低效的
lslqtz
2017-02-28 16:20:29 +08:00
@irainsoft 301 不行
irainsoft
2017-02-28 16:24:23 +08:00
@lslqtz 是我说错了还是方法不对....
yansyuei
2017-02-28 17:24:08 +08:00
插件 SSL Insecure Content Fixer
lslqtz
2017-02-28 18:11:01 +08:00
@irainsoft 方法不对
浏览器遇到 http 的资源, js 在被检测到是 http 时就不会发送任何请求,因此不会得到 301 响应
jiangzhuo
2017-02-28 23:24:14 +08:00
把样式和 html 还有 js 写在一个 html 文件里不就好了……
yesorno
2017-03-01 17:17:22 +08:00
@irainsoft 谢谢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/343780

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX