Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have 2 domains that are registered at GoDaddy :

domaina.com (not hosted, only domain name is registered to GD)
domainb.com (hosted at a different webhost, domain name registered to GD)

domainb.com is an already working site, with a different webhost, but the domain name is registered to GoDaddy (and I assume the nameservers are changed to redirect to the webhost).

Now, I don't understand why this was done, but domainb.com is considered a subdomain on the host... meaning the files are in a seperate folder on the server.
Ex : public-html/domainb.com/public-html/FILES

The structure is similar to this on the webhost:

HostNAME (main root folder)
    domainb.com (subdomain of hostname)
    domainc.com (etc...)
    domaind.com (etc...)

I want to transfer the site domainb.com to domaina.com, meaning domaina.com will become the new website, without having to re-upload all the content and CMS. The old one will redirect to domaina.com once the transfer is done (using 301 redirects).

Can anyone tell me how I can do this?

share|improve this question

2 Answers 2

Assuming you have access to the web server configuration, e.g. httpd.conf, you can just edit the existing domaina.com VirtualHost or create a new one using the domainb.com directory as its root. So if the absolute path to the files for domainb.com is /var/www/public-html/domainb.com/public-html, and you want to host it as domaina.com:

<VirtualHost 10.1.2.3:80>
ServerAdmin webmaster@domaina.com
DocumentRoot /var/www/public-html/domainb.com/public-html
ServerName www.domaina.com
ErrorLog logs/domaina.com-error_log
TransferLog logs/domaina.com-access_log
</VirtualHost>
share|improve this answer

If you are using Cpanel, just use the option Modify and Account and your old domain will be changed into the new one.Thus, the old domain will be deleted from the server and the file will remain.

You will only have to check the db connection after this and check the paths for your scripts ( as they may change as a result of the domain changing).

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.