Subdomain Redirect showing my public IP to page visitors


I created a subdomain with A record
and made a page rule to redirect it to my public IP
as my website is hosted locally and I perform a local NAT inside my firewall

The forward worked fine but it shows my public IP to the vistors on http address I don’t need to show it

Itried 301 and 302 as the only available options to redirect but with no use

Could you please help me urgently on that

Alos SSL certificate not applied to this subdomain

I use the free suscribtion but could transfer to Pro if require to solve this issue

A redirect instruct the browser to visit a different URL. So when you redirect to your public IP it will naturally be shown to visitors.

A rewrite alters where the the request is sent (different server/path) without changing the URL. This is most likely what you’re after.

What I am not sure about is why you don’t just create a DNS record pointing to your public IP? There should be no need to perform a rewrite if you use a separate subdomain.

1 Like

Daer Albert

Thanks for your answer

really I don’t know any other way please describe me the other solution how to do it on DNS and I will follow


I’m not sure exactly what you’re trying to achieve. Usually you just create a DNS record like this.

Thanks very much I will try this …just one more small question
The subdomain appear to be not secure the SSL work only with my main domain
do there any way to bind the SSL to subdomain also to appear on browser secure

You will have to get a certificate for the subdomain as well. You can either get a Cloudflare Origin CA certificate or use e.g. Certbot to have Let’s Encrypt issue one for free.

Really appreciated your help …but what steps to add more certificate and assign it to the subdomain

You have to install the certificate on your origin server. This will secure the connection between Cloudflare and your origin server. Cloudflare will automatically generate a certificate for the connection between clients and Cloudflare.

could you please lead me how to get the certificate from cloud flaire and what option I need to tick to let the clients use this certificate
Locally I will check with sys admins how to apply this on the local hosting server

You can follow this guide to create a certificate: Origin CA certificates · Cloudflare SSL/TLS docs

1 Like

Dear Albert

Thanks very much for your help and suport on the issue


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