Redirect subdomain to site WITH SPECIFIC PORT

Hello,
I’m attempting to configure the redirection of my subdomain test.example.com to test.com:40120 This setup functioned correctly before I began using Cloudflare, but now it no longer works. I’ve attempted to address the issue through page rules and adjustments on the Strato dashboard (where I registered my domain), but neither approach has resolved the problem. Therefore, there seems to be another issue at play.

Thanks!

Greetings,

Thank you for asking.

Working for me with A type DNS record test pointed to temporary 192.0.2.1 and proxied :orange: .

Therefrom, using the Page Rule:

Result with curl and working in my web browser too - just the error about SSL because unknown domain name used for testing.

$ curl -I https://test.example.com/
HTTP/2 301
date: Wed, 03 Jan 2024 23:16:24 GMT
location: https://www.mytest.com:40120/

May I ask if the Page Rule is the first from above on the list of Page Rules which you’d have (if so more than only one)? :thinking:

May I ask if you’ve tried with a different Web browser and device, either network connection type for testing? :thinking:

Could be due to the Web browser cache, or DNS cache on local machine (might need to flush the DNS), or due to the DNS cache at your ISP.

Nevertheless, hopefully the “Pause Cloudflare” option at the bottom right corner of the Overview tab of Cloudflare dashboard for your zone isn’t enabled, which would prevent it to happen? :thinking:

1 Like

Hi, It seems I made an error, and following your solution has resolved the issue. However, a new problem has arisen. Instead of displaying mydomain.com:40120 , it now shows my server’s IP, such as 192.01.14:40120 (not the actual IP). I’m unsure why this is happening. Before implementing Cloudflare, it used to display the domain rather than the IP.
Thank you very much for your excellent assistance!

Hmm, did you possibly configured your local hosts file?
Otherwise, the server, service or app should return this.

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