How do I open a subdomain and point it to the domain?

Thanks to a friend I got help from here a while ago, I was able to connect my IP and port (ex: 168.1.1.1:3000) to a domain name. (ex: example.com) I want to open a subdomain for the domain I connected to. (ex: dev. example.com) and I want to redirect this subdomain to a page in my original domain. (ex: example.com/dev)

I researched how to do this, but either I tried wrong or my settings may be wrong… I would be happy if anyone with knowledge could help…

Have you read the Redirect Rules Cheat Sheet? Is the name that you want to redirect :orange: proxied?

I haven’t seen this before, now I read it. Did I make a mistake?

You haven’t shared enough detail with the Community for anyone here to know if you configured your redirect incorrectly.

At a bare minimum we need to know the domain name and the desired redirect. Seeing the rule would also be helpful.

Excuse me, I think the photo I posted above is not enough. In the photo you will see below, I directed the IP address to my domain name. But since I needed a port on the IP, I redirected it to the “3000” port in the rules section.


That origin rule will connect requests for any hostnames in that domain to your specified port.

I thought you were asking about redirects, not origin ports.

In most of my research, a certain IP was directed to a certain domain. Then the subdomain was opened and redirected to the main domain. Since my redirection is ip:port, I wanted to share it as additional information above because it may cause problems. Currently, my IP and port are connected to my domain name (argoncommunity.com). What I want is to open a subdomain (dev.argoncommunity.com) and redirect this domain to a page in my original domain (argoncommunity.com/dev).

You will need to start with a :orange: proxied hostname for dev or traffic will never find the redirect rule. I prefer to create only a :orange: proxied AAAA record set to the discard prefix of 100::.

Then ensure that your redirect rule matches the hostname of dev.argoncommunity.com and directs it to https://argoncommunity.com/dev.

Any chance of telling me how to do it? Since my knowledge is very limited, I had a hard time directing the ip:port to the domain. :sweat_smile:

And please don’t be angry with me if I say I don’t understand what you’re saying right now. :no_mouth:

I literally did just that in my previous reply. :facepalm:

Actually, I am aware of what you told me to do in your previous answer. I asked you to explain in detail because I didn’t know how to do it…

Use the links. I shared a guide with lots of examples. You can do this.

Even though I have very little knowledge, you did not clearly explain what I should do. Since my knowledge is not sufficient, I shared with you a study I have done before. However, I could not understand your explanations and the sources you cited. Still, thank you for your effort.

I would like a little explanation from other friends who understand what I want to do.

You literally have two painfully simple steps required to accomplish your goal. I am not sure what part you are having trouble with, but you might start by creating the required proxied AAAA record for your dev hostname. You then can create your rule based on example number five in the cheat sheet.

Did I fail to tell you what I wanted to do or did I explain it wrong, sir?

You want visitors to http://dev.argoncommunity.com to arrive at https://argoncommunity.com/dev. This will begin to happen as soon as you comete the two required steps.

Perhaps you could explain which which part of those two steps you are having trouble with.

I want to tell you about my problem and my requests. First of all, I would like to make a clean start by explaining what I did.
I have a VDS machine and I built a site on it using node.js.
Since my site was running on port 3000, domain forwarding needed to be port-based.
I took help from this community and forwarded my IP port to my domain using “rule”.
You can view the community thread here…

What I want now is something like this. But even though I researched and tried several times, I could not get any results.

My request:

  • I want to open a subdomain for my example.com domain. (example: dev.example.com)
  • I want to redirect the subdomain we created (dev.example.com) to a page on my main domain. (example.com/dev)

(even this part is enough, I have another question-oriented request)

  • When you go to dev.example.com, you will be directed to the example.com/dev tab. Can we make dev.example.com appear in the address bar after redirecting?

No. That is not how a redirect works. You visit the source URL and it responds with instructions to go elsewhere. That is how a redirect works. You can’t hang around the old location after you have been told to go elsewhere.

Well sir, thank you for responding to my last request.
Also, do you have any information about the requests in my first two request sentences? If so, can you help?

I dont know what you are referring to by that.

If it is the subdomain and the redirect, that has been covered already.

You should probably break yourself of the habit of considering DNS records to be forwarding. They are nothing of the sort and only serve to map a name to a value. How those values are used depends on what type of record and the value contained bu the label.

Normally a site that listens on a non-standard port would be running behind a reverse-proxy on the same server. Since you have exposed port 3000 directly to the internet you are able to use the Cloudflare reverse-proxy to connect your node app without involving another reverse proxy. That does leave some concern about the security of the traffic between your node app and Cloudflare. How are you encrypting it?