How to map or copy a wordpress site to a subfolder in an existing site's route?

前端 未结 3 1929
南笙
南笙 2020-11-28 15:09

I have a Wordpress blog (blog.xxx.com). I have a nuxt personal website yyy.com which is hosted on aws.

Now I wish to map or migrate the Wordpress blog (blog.xxx.com)

3条回答
  •  失恋的感觉
    2020-11-28 15:43

    Well despite Johannes is perfectly clear for me, i'll try to simplify.

    1. Clone WordPress files from blog.xxx.com to yyy.com/blog directory. (not sure how your server is configured, but probably you'll be able to access it.)

    2. Clone Database to new server.

    3. Run sql replace queries

    UPDATE wp_options SET option_value = replace(option_value, 'https://blog.xxx.com', 'https://yyy.com/blog') WHERE option_name = 'home' OR option_name = 'siteurl';

    UPDATE wp_posts SET guid = replace(guid, 'https://blog.xxx.com','https://yyy.com/blog');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'https://blog.xxx.com', 'https://yyy.com/blog');
    
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://blog.xxx.com','https://yyy.com/blog');
    
    1. update your wp-config.php to match your new database.

    2. login to yyy.com/blog/wp-admin

    3. go to settings and update your permalinks

提交回复
热议问题