mrhuiyu
V2EX  ›  问与答

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

  •  
  •   mrhuiyu · Oct 25, 2015 · 3398 views
    This topic created in 3900 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
        1
    Hello1995  
       Oct 25, 2015 via Android
    F12 Network
    cxbig
        2
    cxbig  
       Oct 25, 2015
    用开发者面板看看网络,网站换到 443 ,你所有相关资源也要切换过去,比方说 js 、 css 、 font 、 image 。
    Showfom
        3
    Showfom  
    PRO
       Oct 25, 2015
    随便就找到一个

    <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
        4
    mrhuiyu  
    OP
       Oct 25, 2015
    看看那一个是没有 https 的吗?
    xfspace
        5
    xfspace  
       Oct 25, 2015
    表示首页就有 11 个 http:
    dototototo
        6
    dototototo  
       Oct 25, 2015
    像我用 Chrome 的话,按 F12 看 Console 试试?
    mrhuiyu
        7
    mrhuiyu  
    OP
       Oct 25, 2015
    @Showfom 那时该怎么改呢?
    mrhuiyu
        8
    mrhuiyu  
    OP
       Oct 25, 2015
    @xfspace
    @dototototo 看到了,但是这类文件该怎么修改呢?
    kn007
        9
    kn007  
       Oct 25, 2015
    @mrhuiyu 。。你懂不懂 https 。。。 https 就是页面请求全面走 https 。
    你自己用开发者工具,就可以看到一堆使用了 http 的请求,只要有 1 个 http 请求,就会提示提示有不安全内容。

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

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

    ob_end

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