Should I host two websites on a single domain?

imkevdev

Kevin Farrugia

Posted on August 5, 2020

Should I host two websites on a single domain?

I have two websites, one for mobile and one for desktop (i.e. this is not a responsive website). Both websites show similar (not identical) content for the same routes, so going to /about-us for each site would show the same content (80-90% similar, main content identical but peripheral content might change) within a different HTML structure.

Ordinarily, I would setup one website on m.mydomain.com and the other on mydomain.com. However we have been looking into using the same domain (no subdomains) for both websites.

A load-balancer would send the traffic to the respective server based on the user-agent (to recognise mobile/desktop traffic). This might seem similar to what Amazon.com does (not aware of the internal workings)

Is this setup a good idea or is it going to lead to problems?

Pros:

  • An improved user experience (debatable)
  • Possibly improved SEO as only a single website is indexed

Questions:

  • Will there be caching issues since assets are different? What about service-workers?
  • What about redirects? If one of the websites has a 301/302 redirect that is cached.
💖 💪 🙅 🚩
imkevdev
Kevin Farrugia

Posted on August 5, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related