Multiple domain names to one wordpress installation

My YunoHost server

Hardware: VPS bought online (Hetzner)
YunoHost version: 4.3.5
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Introduction

Hi all, I’m Friso from NL and I’ve been using Yunohost for about a year now. Very handy system. Thanks for making my life easier.

Description of my preferred use case:

I’ve installed a wordpress application that I’d like to target from multiple domain names. E.g.: domainname.one / domainname.two / anotherdomain.three should all go to the same wordpress site, there I will alter certain content according the the domain.

How do I go about setting this up in YunoHost? I could not find the answer in the help files or on this forum. I hope there are people out there with a few helpful suggestions. Thanks in advance.

Hi Frisonl,

Welcome to the forums!

I am not quite sure what you mean with

Could it be that you look for a multisite installation? It is an option when installing Wordpress,
image

That would give three distinct sites if I recall correctly. Of course you can point three domains to a single Wordpress installation (using the redirect app), but that would give an identical site for the three different entry points.

Did you have a look at the Wordpress plugins over at Wordpress, if there is something that matches your needs?

Hi Boudewijn, thanks for your help. The redirect plugin might be a solution. Except after I set an invisible redirect I get a 502 redirect ngynx error on the redirected domain. Any idea what could be the issue now?

So:
domainnameone.com has a wp install
domainnametwo.com has the redirect app installed redirecting to: domainnameone.com as invisible redirect.

(about why this way:)
I will change content on one WordPress install according to the host name, for organizational reasons this is better than a multisite.

I think the problem is that you set an invisible redirect. Did you have a look at the readme?

For your use case, 301 or 302 (depending on whether you want to keep the three domains ‘merged’ or that it will change in the not to far future).

Thanks again. Well, with a 301 or 302 it simply forwards the visitor to the other domain. But I need a dynamic hostname.

Ah, ok. I think I can not help you with this myself, but I try to describe your situation to make sure I understand correctly. Among other domains and services, your Yunohost runs

  • Wordpress “Friso’s Blog”
  • domain fri.nl
  • domain so.nl
  • domain friso.nl

No matter whether people visit fri.nl or so.nl, they will always see “Friso’s Blog”, not knowing that it is actually running on friso.nl; the text on the site is identical in each case, but the address that they see in the browser is different (either fri.nl, so.nl or friso.nl, depending on what they typed in their browser).

Is there any more information in the nginx-logs?

I think the term you are looking for is reverse proxy. Maybe when you read about some use cases for reverse proxies via nginx, you will recognize your situation. When not, it is still a step forward in narrowing your problem.

Sorry not to be of any more help!

@frisonl Did you ever find a solution?
I’m struggling with this.

hi @utkarshsethi, unfortunately not. If you or anyone else finds out how to do this, I would be eager to know.

1 Like

while not ideal, you could edit the ngix files manually and set the same folder for your alias domains.

see if it works for you?