Is That Possible To Transform URL To Another Domain or Subdomain using Transform Rules?

Hi,

I have the domain filmisongs.com and subdomain with files mp3.filmisongs.com and want to transform my URLs from

Filmisongs: All Latest Songs Mp3 Download Free Online
To
403 Forbidden

Is that possible with Cloudflare’s Transform Rules?

Unfortunately, Cloudflare doesn’t let users modify Host Headers due to the risk of abuse. Only Enterprise plan users can do this with special permission.

1 Like

Thanks for the reply, If Cloudflare allows it on the subdomain level or to domains available in the user dashboard, That would be great. I think at this point to rewrite your own domains header will not lead to any abuse.

Imagine anyone can rewrite their Host header to www.google.com without restrictions due to the ease of use of Transform Rules. There will be so many Google clones out there.

I think they meant for “your own domains”.

I’m not even sure there’s a real need for this. If you’re transforming the hostname to your own server, why not just configure the server to treat it as an alias?

1 Like

sdayman Right, I’m just asking about for own domains or subdomains configuration with the header.

Yes, It’s a good idea to set up these configs on the server end, Cloudflare is a facility to change the header in a quick way with no server end load and configs. but if the user has to set all config from the server end then why do we need to use Cloudflare Transform URL.

As I wanted to transform my URLs from domain.com/mp3/$ to sub.domain.com/$ but here Cloudflare transform is useless for me.

The exception is in a load balancer.

https://developers.cloudflare.com/load-balancing/additional-options/override-http-host-headers

1 Like

Couldn’t a similar result be achieved using Pages Rules to forward from one to another?
Something like:

domain.com/mp3/*
Forwarded to
sub.domain.com/$1

?

I think what’s going on is they want to use a single domain name in their code, but have MP3s from a subdomain mapped to the main domain.

It could be done with a worker, like pulling content from an S3 bucket, but that costs money.

Even outside of this particular scenario, it is a feature that has plenty of use cases.

I have access to Host Header Override, and it makes it relatively easy to try and use a single namespace, while consuming multiple backend services. The limitation was always that the public namespace had to exactly match the Origin namespace (unless you are willing to take on the cost of Workers). Combining Host Header Override with Transform Rules makes that much easier, and is definitely something I’m looking at. My goal is to have just www.example.com, and all public resources sit within that, rather than blog.example.com, product.example.com etc.

1 Like

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