Redirect the url to R2 url

I have my static assets served via

now i have uploaded my static assets to R2 storage and mapped to domain and i can access this url

Now i want to create a rewrite rule so that if anyone try to access then it gets rewritten to

I have created a redirect rule which is working fine but i want to create a rewrite rule so that user dont know if its getting redirected to new url.

If i got go to rewrite rule page then i cant see any setting to reqwrite the host

Unless you’re on an Enterprise plan, you can’t do host overrides (change the hostname behind the scenes).

You would have to use a Worker, like this example:

1 Like

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