Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How should I transfer my WordPress blog from the root of my domain to a sub-directory?

If everything including root in an installment of WP 3.2.1 were moved to a sub-directory, would the default permalink structure update to it? e.g. domain.com/wp-sub instead of wp-domain.com?

Also, should I modify any code or settings and, if so, what exactly?

share|improve this question
2  
They will work, you don't have to do anything –  onetrickpony Nov 28 '11 at 0:37

2 Answers 2

I think you should also run a few MYSQL queries to make it work:

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

UPDATE wp_posts SET guid = replace(guid, 'http://example.com','http://example.com/blog');

UPDATE wp_posts SET post_content = replace(post_content, 'http://example.com/', 'http://example.com/blog');

If your permalinks are still not working, delete the .htaccess file, and go to Settings->Permalinks and click save to create the .htaccess file.

share|improve this answer

Moving all files from root to a subdirectory will work.
Don't forget the .htaccess file.
Just after move the files, you should change the root path in Configuration -> General - Site address. To the right direction.

i.e. Moving from http://example.com to http://example.com/blog/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.