Bulk Redirects - Pass Referrer

I have a customer that is taking Domain A and redirecting it all to Domain B but on a per page basis to retain the SEO value. When the visitor reaches Domain B we want to welcome the user but only if the user is coming from domain A. For that to work we need to pass the URL or domain for Domain A in the header so Domain B can trigger a message based on the referrer. How can this be done in the bulk redirects tool? *Note for SEO reasons we do not want to pass parameters in the URL to achieve this as this negates the purpose of redirecting the URL to retain the SEO equity.

From what I know this is not possible with Cloudflare’s Bulk Redirects or any other server-side redirect service. Browsers only set the Referer header on redirects initiated by JavaScript. You will have to either serve a basic HTML page that does a JavaScript redirect or include the domain in a query parameter.

Albert…there are specific instructions on how to do this already with the Cloudflare workers. This is extremely common in domain migrations…done it multiple times with other CDNs as well as server side. The question is do we have the ability to do this with the Cloudflare bulk redirects or are we forced to use the workers approach?

Redirects and rewrites are different. Redirects change the URL while rewrites keep it the same. What you’re describing is a rewrite - OP wants to do a redirect.

Been in tech 30 years Albert…I know the difference between a rewrite and a redirect. Again Akamai and other CDNs accommodate this with their redirect tools. The question is whether Cloudflare accommodates this with their Bulk Redirect tool. Again this is a common problem when you work in the IT world for any length of time. Most migrations need some level of this type of support.

Could you please share an example Worker that does this? I’m interested in knowing how this works

Bulk Redirects don’t offer any functionality beyond “when URL is X redirect to Y”, so I don’t think it’s possible to achieve what you’re describing. But I can say for sure if you share how this is done with a Worker :slightly_smiling_face:

1 Like

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