mrhuiyu
V2EX  ›  问与答

wordpress 使用了 https 但是提示有不安全内容如何发现那些是不安全内容并删除呢?

  •  
  •   mrhuiyu · Oct 25, 2015 · 3577 views
    This topic created in 4033 days ago, the information mentioned may be changed or developed.
    我网站使用了 https ,其他界面包括后台都是正常 https ,但是首页就是会提示有不安全内容
    http://loveshan.net/wp-content/uploads/2015/10/捕获.png
    19 replies  •  2015-10-26 08:46:54 +08:00
    Hello1995
    Hello1995
    Oct 25, 2015 via Android
    1
    F12 Network
    cxbig
    cxbig
    Oct 25, 2015
    2
    用开发者面板看看网络,网站换到 443 ,你所有相关资源也要切换过去,比方说 js 、 css 、 font 、 image 。
    Showfom
    Showfom
    PRO
    Oct 25, 2015
    3
    随便就找到一个

    <link rel='stylesheet' id='wp-player-css' href='http://loveshan.net/wp-content/plugins/wp-player/css/wp-player.css?ver=2.5.1' type='text/css' media='screen' />
    mrhuiyu
    mrhuiyu
    OP
    Oct 25, 2015
    4
    看看那一个是没有 https 的吗?
    xfspace
    xfspace
    Oct 25, 2015
    5
    表示首页就有 11 个 http:
    dototototo
    dototototo
    Oct 25, 2015
    6
    像我用 Chrome 的话,按 F12 看 Console 试试?
    mrhuiyu
    mrhuiyu
    OP
    Oct 25, 2015
    7
    @Showfom 那时该怎么改呢?
    mrhuiyu
    mrhuiyu
    OP
    Oct 25, 2015
    8
    @xfspace
    @dototototo 看到了,但是这类文件该怎么修改呢?
    kn007
    kn007
    Oct 25, 2015
    9
    @mrhuiyu 。。你懂不懂 https 。。。 https 就是页面请求全面走 https 。
    你自己用开发者工具,就可以看到一堆使用了 http 的请求,只要有 1 个 http 请求,就会提示提示有不安全内容。

    道理就是 http 改成 https 会不会?
    mrhuiyu
    mrhuiyu
    OP
    Oct 25, 2015
    10
    @kn007 额,我去找找资料。。。。
    wql
    wql
    Oct 25, 2015 via Android
    11
    如果是原生 https 的话直接改后台设置里面 https 。
    然后到 mysql 数据库 post 表里面批量替换

    ……我这话好像够清楚了,也就这么多。
    mrhuiyu
    mrhuiyu
    OP
    Oct 25, 2015
    12
    @wql 额。。。。谢谢。
    Showfom
    Showfom
    PRO
    Oct 25, 2015
    13
    @mrhuiyu WP 后台改地址, MySQL 里把 http 都替换成 https
    Slienc7
    Slienc7
    Oct 25, 2015 via Android
    14
    WP 的后台有 HTTPS 选项 开启应该就可以了,另外记得发文章时的引用图片时不要用 http
    loveyu
    loveyu
    Oct 25, 2015
    15
    ob_start

    ob_end

    str_replace("http://...","https://....");
    crazycen
    crazycen
    Oct 25, 2015 via Android
    16
    火狐 点证书图标
    alect
    alect
    Oct 25, 2015
    17
    随便看看源代码都发现最后引用的文件是 http 协议
    crazycen
    crazycen
    Oct 26, 2015
    18
    UPDATE typecho_contents SET text = REPLACE(text,'http://xx.com/wp-content/uploads/','https://xx.com/wp-content/uploads/');
    crazycen
    crazycen
    Oct 26, 2015
    19
    @crazycen 表名替换一下!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2248 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 00:18 · PVG 08:18 · LAX 16:18 · JFK 19:18
    ♥ Do have faith in what you're doing.