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

General Discussion

Scott Paterson
Scott Paterson
26,869 Points

Using a few domain names for one site best practice

Hey folks

Ive purchased a couple of domain names

The story is

That someone is taking over a current Wordpress website and new owners are wanting there domain names to point to current web site with there new names. the current owner he is still wanting his own domain to point here as well as the new ones.

for example its changing from the old name with Petespetshop to Charlespetshop or chicspetshop and editing contact information.

What would be the best practice to redirect new domain names to a current website, should i use URL Forwarding 301 redirect or editing inside Nameservers

5 Answers

If you want the whole site to now be found at a new, replacement domain you should install the WordPress site on the new domain and 301 all old URLs to their new equivalent.

A .htaccess might look a bit like this

RewriteEngine On
RewriteRule ^(.+)$ http://charlespetshop.com/$1 [R=301,L]

Not tested.

Scott Paterson
Scott Paterson
26,869 Points

Hi Mike thanks for your reply, i should mention that the hosting is staying the same, the current owner is tied into hosting for a period and he still wants to keep his domain as he is going to be around on the site offering services but on a smaller scale.

So the new domain will probably be an Add On domain, in which case you'll move the WordPress files into it's directory and update the WP settings to use the new URL (e.g. wp_options table for options like site_url and home_url). There are plugins to help update WordPress after a move.

The old domain will probably still be the main domain on the hosting account and you'll use a .htaccess file like the one I posted (which probably has a bug, but it's a start!) to redirect all URLs to the new address.

Scott Paterson
Scott Paterson
26,869 Points

Hi Mike so far at present it is just extra domain names there is no extra hosting all the files etc will be staying where they are does that change anything you have suggested?

really appreciate your help sometimes i am not the best to explain whats in my head ha ha

What do you mean extra domains? Presumably you'll pick one that the site loads from and the others will redirect there? Unless you're planning on duplicating the whole site at two domains which isn't a good idea.

Adam Greenough
Adam Greenough
7,742 Points

If you're using cPanel, you can use a parked domain to simply mirror your current domain. Other panels may have different terms for it. But it's definitely possible just to keep your current domain, park another domain on top of it.

www.domain1.com/bla & www.domain2.com/bla will both point to the exact same place. You can then change the Wordpress URL which will mean that once a user hits the site, all links will point to the new domain and users can begin to make the transition. Eventually you should find hardly any users are using the old domain and you can phase that one out.

Scott Paterson
Scott Paterson
26,869 Points

Hi Adam the hosting was something i inherited, i'd move in a second if client wasn't tied in, no c panel or any thing similar which is frustrating cant really do much about domains, so what i did was where i bought the new domain names i just did a redirect there through there so the new names go to current name/hosting site.