Redirect a subdomain to another

My YunoHost server

Hardware: Raspberry Pi at home
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

I would like to redirect a subdomain to another subdomain. I don’t know if the easiest way is to do so on my server or in the dns config of my domain name provider (ovh).

Precise description of expected behaviour: when the URL urla.mydomain.org is entered by the user in a browser, the address explicitly changes in the address bar to urlb.mydomain.org and load the page right away.

The use case: I share/publish a a single url urla.mydomain.org but want to be able to change to which subdomain this link lead after the link is in the hand of others. Curently, I want it to link to urlb.mydomain.org but want to be able to change that in the future if I ever want to.

Thanks a lot for your time and help ! :grin:

If you want to redirect urla.mydomain.org to urlb.mydomain.org, I would recommend installing the redirect app and install it on the root path i.e / and changing the redirect destination path to https://urlb.mydomain.org

But, if you want to keep the URL parameters i.e urla.mydomain.org/something redirects to urlb.mydomain.org/something, in the redirect destination path write https://urlb.mydomain.org$request_uri

Edit: Do make sure you have added the domain urla.mydomain.org to your YunoHost server

1 Like

Thank you so much, I didn’t even think to look if such an app existed. To be honest I was convinced it should be done in the DNS configuration. I try this right away and keep you updated ! Much love :green_heart: :green_heart: :green_heart:

Update : Everything works as expected !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.