简体   繁体   中英

How to move wordpress from root directory to sub directory?

I have tried creating sub directory named "blog" in root. I have placed index.php from root to sub directory. I have tried below code:

<?php require('./wp-blog-header.php'); ?> 
to 
<?php require('./blog/wp-blog-header.php'); ?>

But it didn't work. So give me another solution.

尝试这个 -

<?php require('../wp-blog-header.php'); ?>

您可以设置多站点wordpress。

copy and paste all contents from main directory to your sub directory. and do the following.

1.Open your wordpress database , select table wp-options from there,where you need to change the following rows..
a). select siteurl row from wp-options and change it from http://yourdomain.com/ to http://yourdomain.com/blog/
b) select home row from wp-options and change this also from http://yourdomain.com/ to http://yourdomain.com/blog/

2.After completing this reload your site if it shows any error .Login to your wordpress dashboard and re-create permanent-link (setting-> permanent-link). just select a structure and save to re-create permanent link.

thats all it must works..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM