Best way to move site from subdomain to root through cPanel?

Posted by Mbbc on Pro Webmasters See other posts from Pro Webmasters or by Mbbc
Published on 2014-06-05T10:02:21Z Indexed on 2014/06/05 15:39 UTC
Read the original article Hit count: 122

Filed under:
|
|

I have an old Wordpress blog hosted on a subdomain (sub.mysite.com) with hundreds of posts.

The root domain is actually empty and redirected to the subdomain.

Now I want to move the site from the subdomain to the root domain.

I found some .htaccess examples like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.example.com$
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

This redirection seems to work if I clone or move the subdomain site into the root domain but, Is there an easier way? I mean, just like when you redirect from www. to non-www. and you only have one site installation. The site would be kept installed on subdomain folder but it would be accessed from root domain, is it possible?

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about redirects