Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

New Website for a pre-existing domain name

I have a domain name managed by an old version of Joomla. I want to build a new website with Wordpress and then redirect the old domain name to the new wordpress site.

Obviously I can't register the domain name if it's already registered. When I finish building the site locally, I need to migrate it to the web prior to redirecting the old site.

How do I upload the locally developed website to the web without doing so under a different domain name? I understand that I can set up redirects, but to do this would simply cause my old site links to redirect to my new site. But to do this would imply that my old domain name points to a new one (right?).

In the wordpress development track, we learn to register a domain name and then upload a locally developed site to the host to which that domain name points. My understanding is that I cannot upload a locally developed site to a host without having a domain name to point to it. However, I realize this does not make sense since one can use a different provider for hosting and DNS registration. Thus, my question is: How can I upload a website to a host and then assign a pre-existing and currently-registered domain name to the new website so that any attempts to access the website will direct visitors to the new site? This is more complex than a mere redirect project because when people click on the Google results for my old site, I don't want the site to redirect to a new domain name with a different URL...

E.g.

Old site url: www.website1.com New site url: www.website2.com

Redirect old site url to new site url so that clicking on www.website1.com redirects to www.website2.com...

That is NOT what I want to do: I want the new website developed on wordpress to retain the same DNS and url as the old site, so that there is no distinction between website1 and website2 in terms of url or DNS.

Further, will this interfere with emails? Many people have my email associated with my website and I receive a lot of emails on a daily basis. How do I insure the integrity of my email account during this process?

4 Answers

You can upload a website to hosting without a domain name. There are a few different ways you can do this but the easiest would be to set up your new hosting with your current domain name, upload the website to this hosting (your hosting provider will give you an IP address to use instead of a domain name (until your ready for your new website to go live on the existing domain). When your ready for your new website to go live you need to repoint your DNS to you new hosting (the IP address I mentioned previously). As long as you don't touch your MX DNS records, there will be no changes to your email.

You should also Google 301 redirects as I assume your new website will have different URL's to your current one and this will cause problems when people find your website via Google (the will be sent to a 404) and you don't want this.

Thank you for the timely response.

So I can set up new hosting using the same domain name as the site I want to change? The old site is hosted by a DIFFERENT provider than I will be using to set up the new site.

Using Hostgator, the only way I see to sign up for hosting is with a domain name. In their sign up options, I entered the web address of the site I already own and hit the "I already own this address" option. I chose the optimized wordpress option here as well.

Despite this, I cannot access Wordpress Admin pages because the web address still points to the old site.

Where does my misunderstanding of the entire process lie?

It doesn't matter if you use a different host or not. As long as it's on a different server.

The web address will point to the old site until you change the DNS. Hostgator will have given you an IP address for your new server along with a temporary URL for your website. You need to use this to manage your website until you change over the DNS.

Websites are hosted on servers. Servers use IP addresses to identify each other and communicate with each other. Humans use domain names in place of these IP addresses. So when you enter www.google.co.uk in your browser, the browser will go out and find the IP address of that URL and then find the server corresponding to that IP address. You have set up a new server with a new IP address. Later on when your ready you will redirect your DNS to point to the new server (IP address). Until you make this change you can access your new hosting/server via it's IP address which Hostgator will have provided you somewhere in a welcome email.

This is not what is happening. When I registered for HostGator, I entered in the domain name that I already have registered. The email that HostGator sent me, and the IP address, direct me to the regular site that is hosted on Joomla, with the extension /wp-admin. Naturally, a 404 error results

HostGator is just giving you the URL that you have registered. You need to navigate to the IP address / temporary URL that HostGator has given you for your new hosting.

They are telling me that the only way I can build the site is to change hosts file since the URL I registered is still pointing to the old DNS. Is this compatible with what you've described?

It appears HostGator have removed the ability to view your site via a temporary URL:

http://support.hostgator.com/articles/hosting-guide/lets-get-started/temporary-url

No idea why, not come across it before.

You can view a guide to manually add the IP of your server into your hosts file here:

http://support.hostgator.com/articles/how-do-i-change-my-hosts-file

Not sure why they have done that. It makes things much more complicated. I guess this is one of the downfalls of managed hosting, your at the whim of their decisions.

Add the IP to yours hosts and your machine only will be able to view your new website. When your ready update the DNS of your domain.