If you have a CNAME record vid.logerp.com.tw. CNAME logvid.ddns.net.
, this will ensure that the domains vid.logerp.com.tw
and logvid.ddns.net
both point to the same IP address. But pointing to the same IP does not mean the same website/service is actually served from both domains.
Imagine Alice tries to visit https://logvid.ddns.net from her browser, on her computer. If we pretend that your server IP address is 1.2.3.4, here is what happens:
-
Alice's computer
to DNS server
:
Hello, I am looking for logvid.ddns.net, do you know where that is?
-
DNS server
to Alice's computer
:
Yes I do, I have an A record for it, it is at 1.2.3.4
, have a nice day!
-
Alice's computer
to 1.2.3.4 (your server)
:
Hello, I am looking for https://logvid.ddns.net, I believe you are the server serving this website?
-
1.2.3.4 (your server)
:
Oh yes, https://logvid.ddns.net is where I keep my PeerTube instance! I need to give it to Alice
-
1.2.3.4 (your server)
to Alice's computer
:
Why yes, I have the website you are looking for, here you go! Gives Alice the PeerTube instance
Now imagine Alice tries to visit https://vid.logerp.com.tw from her browser, on her computer. If we pretend that your server IP address is 1.2.3.4, here is what happens on your current configuration:
-
Alice's computer
to DNS server
:
Hello, I am looking for vid.logerp.com.tw, do you know where that is?
-
DNS server
to Alice's computer
:
I have a CNAME record for it, it seems to be in the same place as logvid.ddns.net, you will have to ask for that. Have a nice day!
-
Alice's computer
to DNS server
:
Hello, I am looking for logvid.ddns.net, do you know where that is?
-
DNS server
to Alice's computer
:
Yes I do, I have an A record for it, it is at 1.2.3.4
, have a nice day!
-
Alice's computer
to 1.2.3.4 (your server)
:
Hello, I am looking for https://vid.logerp.com.tw, I believe you are the server serving this website?
-
1.2.3.4 (your server)
:
Hmm, it seems that https://vid.logerp.com.tw does in fact point to me, but I don’t seem to have any specific apps or websites installed here. I’ll just give Alice the YunoHost admin panel, I guess
-
1.2.3.4 (your server)
to Alice's computer
:
Why yes, I have the website you are looking for, here you go! Gives Alice the admin panel
What you need to do is tell your server that whenever someone comes asking for https://vid.logerp.com.tw, they need to be given whatever is at https://logvid.ddns.net.
The simplest way to do this is to install the Redirect app on the root of https://vid.logerp.com.tw, with the redirect pointing to https://logvid.ddns.net.
When installing the app, you can choose between a visible rediect or an invisible proxy.
Here is how Alice’s browsing goes if you make a visible redirect from https://vid.logerp.com.tw to https://logvid.ddns.net:
Steps 1-5 are unchanged
5. Alice's computer
to 1.2.3.4 (your server)
:
Hello, I am looking for https://vid.logerp.com.tw, I believe you are the server serving this website?
6. 1.2.3.4 (your server)
to Alice's computer
:
Oh, you are looking for https://vid.logerp.com.tw? Actually that was moved to https://logvid.ddns.net, you will want to ask for that
7. Alice's computer
:
Oh, it seems what I want is actually https://logvid.ddns.net. Let’s change the URL in the browser address bar to https://logvid.ddns.net to reflect that
8. Alice's computer
:
Let’s see, I just asked for the location of logvid.ddns.net a moment ago, I don’t need to ask again so soon, it’s almost certainly still at 1.2.3.4
9. Alice's computer
to 1.2.3.4 (your server)
:
Hello, I am looking for https://logvid.ddns.net, I believe you are the server serving this website?
10. 1.2.3.4 (your server)
to Alice's computer
:
Why yes, I have the website you are looking for, here you go! Gives Alice the PeerTube instance
Here is how Alice’s browsing goes if you make an invisible proxy from https://vid.logerp.com.tw to https://logvid.ddns.net:
Steps 1-5 are unchanged
5. Alice's computer
to 1.2.3.4 (your server)
:
Hello, I am looking for https://vid.logerp.com.tw, I believe you are the server serving this website?
6. 1.2.3.4 (your server)
:
Hmm according to these instructions I have in my config files, whenever someone asks for https://vid.logerp.com.tw, I actually need to give them whatever is at https://logvid.ddns.net. So I need to give Alice the PeerTube instance
7.
Why yes, I have the website you are looking for, here you go! Gives Alice the PeerTube instance