Moving My Blog To A Sub-folder

After working with John Thornhill and his Partnership group, I have decided to move my WordPress Blog from the front page on my domain name back to a ‘blog’ sub-directory.

I already have my blog set up on my domain name so I am moving my blog to a sub-folder so that it appears as I have performed this task of moving a blog many times before for my clients, sometimes to a new sub-folder, sometimes to a new domain name and sometimes to a new hosting server – it’s not hard but you can get it wrong and need to fix it up in the database. I thought I would list the steps below to make it DEAD EASY, so here you go.

1) Firstly you need to modify the domain name in the WP settings, otherwise you will not be able to log in to your WP Dashboard later and you will have to move everything back and start over.

Change the URL for your blog to the new address

Change the URL for your blog to the new address

2) Now you will get an Internal Server Error because your site cannot be found in the place you have just reconfigured it to – don’t worry!

You can expect an Internal Server Error now!

You can expect an Internal Server Error now!

3) Now you need to create the ‘blog’ folder in your files area of your website files and move all the other files in to that new folder (except for .htaccess and ,ftpquota)

WP - Move files

4) Your file manager may get a little left behind in the directory tree on the left hand side and think the folders still exist, but it will sort itself out the next time you open file manager in your CPANEL.

WP - confused

5) The step above modifies your .htaccess file to load your blog from your new folder, so even if I go to my domain name, it will still show my blog nicely. I can change this later when I want to place some specific content onto my main website page.

The .htaccess file has been modified to load my blog correctly

The .htaccess file has been modified to load my blog correctly

6) It would be a good idea to make a copy of the .htaccess file in the new blog folder so that later it will continue to work nicely when no longer being accessed from the main website URL. This is easier to do than you might think though because if you go to the Settings->Permalinks menu in your Dashboard, WP will automatically regenerate a local .htaccess file for you.

WP - new htaccess

After doing this, anybody visiting my domain name will see my blog and can navigate around it quite nicely – because they will immediately be sent to for all further access.

Two problems

The first snag with this is that if I try to log in to the dashboard, it fails – it just needs the /blog/ added in to the URL of course.

The second issue is that all the images in the original blog have the URL hard-coded and that means they no longer work.

Leave A Response

* Denotes Required Field