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
Scott Paterson26,869 Points
Using a few domain names for one site best practice
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
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
RewriteRule ^(.+)$ http://charlespetshop.com/$1 [R=301,L]
Scott Paterson26,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.
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 Greenough7,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.