dacongm
V2EX  ›  WordPress

求 wordpress 配置高手

  •  
  •   dacongm · Oct 14, 2023 · 2027 views
    This topic created in 966 days ago, the information mentioned may be changed or developed.

    碰到个问题:用了 wordpress ,现在有 3 个域名。如何能改成 1 个,而且页面不出问题。 1 、上线前 wordpress 之前设置的时候,用了 http://ip 的方式 2 、后来配置用了 http://domain 3 、然后配置成了 https 即 https://domain

    但是上 CDN 过程中,3 个域名,就会出现跨域问题。

    4 replies    2023-10-18 05:05:59 +08:00
    mskumiko
        1
    mskumiko  
       Oct 14, 2023
    数据库替换掉 IP 地址为域名 https://domain
    开 https 后,CDN 或者宝塔面板都有“强制 HTTPS”选项啊。所以 2 3 不是问题啊。

    1 的问题百度一下 : wordpress 更换博客地址 sql 就有答案了。
    jeffw
        2
    jeffw  
       Oct 14, 2023
    ```
    UPDATE wp_posts SET post_content = REPLACE( post_content, 'http://ip', 'https://domain');
    UPDATE wp_postmeta SET meta_value = REPLACE( meta_value, 'http://ip', 'https://domain');
    UPDATE wp_posts SET post_content = REPLACE( post_content, 'http://domain', 'https://domain');
    UPDATE wp_postmeta SET meta_value = REPLACE( meta_value, 'http://domain', 'https://domain');
    UPDATE wp_options SET option_value = 'https://domain' WHERE option_name = 'siteurl' or option_name = 'home';
    ```
    isc
        3
    isc  
       Oct 14, 2023 via Android
    带 https 免费证书那只能以一个为主,其它的只能 301 跳转
    Conantv2
        4
    Conantv2  
       Oct 18, 2023
    先用 2 楼方法改数据库的,再写个简单插件在 shutdown 实现 HTML 输出前的字符串替换,基本上万无一失

    https://stackoverflow.com/questions/772510/wordpress-filter-to-modify-final-html-output
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1009 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 18:47 · PVG 02:47 · LAX 11:47 · JFK 14:47
    ♥ Do have faith in what you're doing.