ABHIONLINUX
Site useful for linux administration and web hosting

2011/01/14

Move worpress site from subfolder to root

Assume that wordpress is installed in /blog folder and root domain is abhionlinux.co.cc
You can follow the steps below to move the blog to root dir.

1. Backup the folder /blog , this is done as  a precaution.
2. Copy all the files in blog to root dir, make sure .htaccess file is also copied. There shouldnt be any index files such as index.php or index.html.
3. Add the following line in wp-config.php under root dir.


define('RELOCATE',true);

4. Open the URL abhionlinux.co.cc/wp-login.php and enter the admin login details.
5. Go to general settings, Make sure  in wordpress address field  you have abhionlinux.co.cc(root dir) and make blog address URL as abhionlinux.co.cc(root dir). Most likely it will be having
http://abhionlinux.co.cc/blog, dont leave '/' in domain name.
6. Check htaccess in root dir and make sure it is similar to the one given below.
====================
IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
IfModule
===================

Now your wordpress site is move from subfolder to root dir. 
7. You can remove the line below from the file wp-config.php

define('RELOCATE',true);

Try it out !!!



No comments:

Post a Comment