• wordpress更改domain域名和數據庫連接


    1.0 database connection

    define( 'DB_NAME', 'db_table' );
    define( 'DB_USER', 'db_name' );
    define( 'DB_PASSWORD', 'db_password' );
    define( 'DB_HOST', 'db_host' );
    

      go to {root}/wp-config.php

    2.0 change wordpress db table

    wp_options -> siteurl = 公众访问的网络位址
    wp_options -> home = 公众访问的网络位址

    3.0 run sql script to update siteurl & home on post content

    UPDATE wp_posts SET post_content = REPLACE(post_content, '{old_domain}/wp-content/uploads', '{new_domain}/wp-content/uploads');
    UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '{old_domain}/wp-content/uploads', '{new_domain}/wp-content/uploads');
    

      If you save old_domain on wp_postmeta, you will need to update them also.

  • 相关阅读:
    DHCP脚本
    7.31
    7.30
    7.26
    7.24
    VLAN与三层交换机
    静态路由配置
    7.17
    四次挥手
    TCP三次握手,四次挥手
  • 原文地址:https://www.cnblogs.com/chenkuang/p/16363743.html
Copyright © 2020-2023  润新知