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

Boris Kamp
Boris Kamp
16,660 Points

have some pages of my Wordpress site sit on another domain

My new client would like to have one main domain, lets call it maindomain.com. The client offers multiple services that are pretty specific and not really related to each other. There are 4 services:

  • service A
  • service B
  • service C
  • service D

Now he has the idea to buy different domains for those services and map those pages to those domain. For example, I visit maindomain.com, there's:

  • maindomain.com/contact
  • maindomain.com/about-us
  • main-domain.com/approach
  • maindomain.com/services those are all on the maindomain.comdomain. Now from the navbar and the maindomain.com/services page, the user should be able to navigate to the single service pages. When the user click Service A from the services archive page, the user should go to service-a.com.

In other words, can I map some pages to a different domain like this huge webshop from the netherlands? https://www.coolblue.nl/ (main domain) https://www.laptopshop.nl/ (domain just for selling laptops)

How would this go SEO wise? My opinion says the service pages could get stronger because they have their own domain.

I've done some research and it looks like I can do this with the .htaccess file only, is this true?

Edit to be more clear I would like to maintain the Wordpress installation from one single installation just like it was a regular one-domain Wordpress install.

1 Answer

Have you considered wordpress multisite? Or do you literally just want a page to have a different URL?

Either way .htaaccess is a config for the apache webserver - a redirect there will redirect traffic before getting to the wordpress part. For example say you own mydomain.com and mydomain.net. You can point their DNS at the same webserver and set the htaaccess to serve mydomain.com to people who are trying to access either. If you typed mydomain.net, you get "redirected" to mydomain.com, because the apache server sees that for mydomain.net requests it should serve mydomain.com. So you set the htaaccess to redirect the traffic onto one wordpress install, but you still need to update the wordpress to know about the change too.

You'd need to change the wp_config file I believe, but there are plug ins that will let you do this too. If it's just one page, then using a plugin for domain mapping is a good idea, if you're really looking at two sites on one install, then look at wordpress mutisite :)

Boris Kamp
Boris Kamp
16,660 Points

Hi Jon Mirow,

Thanks for elaborating! I think multisite is not needed because I indeed 'just' need to put the 4 services pages on different domains. Is this a smart approach SEO wise?

Hi, yes sorry, I had a fair few notifications this morning with the new courses, and I'm afraid I missed this sorry!

To be honest I'm not totally sure. AFAIK they're pretty much equal so long as you use domain mapping.

SEO's basically an ongoing war - we want google to display our content, google wants to display the best-matching content for the search parameter, ergo we never really know exactly how it works, and google want to make sure of that. They let us know enough to make their lives easier, but change their algorithms whenever people start catching on.

The crawlers will know the sites are coming from the same place, but as long as they're mapped, so they're not crawling over other domains to get to the content, most other SEO factors will significatly outweigh any difference between them, I'd expect.

Really I think you could just come down to do you want different themes on the domains? If yes, use multisite :)

I think this might help with the SEO: https://premium.wpmudev.org/blog/wordpress-multisite-seo-your-questions-answered/?utm_expid=3606929-106.UePdqd0XSL687behGg-9FA.0&utm_referrer=https%3A%2F%2Fwww.google.com.au%2F