A rule to convert old.com/downloads to new.com/download

What is the name of the domain?

What is the issue you’re encountering

We have a page on an old domain which is /downloads and I would like a rule to redirect this to our new domain where the page is hosted at /download (without the ‘s’). Would someone be able to suggest the best way to achieve this? Thanks

Hi @jonathan.shapiro,

Assuming the old domain is on Cloudflare you can use a page rule to redirect the traffic from
https://old-domain/downloads to https://new-domain/download

You can setup this rule in your dashboard for the old domain
In the rules section add a new rule “Redirect to a Different Domain”

  • Chose a name for your rule
  • Use a custom filter expression
  • Field = URI, Operator = equals, Value = /downloads
  • The filter should look like this: (http.request.uri eq “/downloads”)
  • Then set the redirect type to static with https://new-domain/download as the URLand use an appropriate status code. In this case sounds like “301 - Moved Permanently” would be best
1 Like

Thanks for the reply.

Yes, the old domain and the new domain are managed by Cloudflare.

I tried your suggestion which was very similar to the version I tried myself but it generates a redirection to this:

https://new-domain/download/downloads

where I am looking for it to be: https://new-domain/download

This is the expression preview:

(http.request.uri eq “/downloads”)

and this is the static URL I have set: https://new-domain/download with a 301 status code.

Any suggestions? Thanks

Hi Jonathan,

Could you confirm if you are setting up this rule on the old domain, also have you got any other rules on the new domain.

Also, if you could let me know the old domain will be much easier to debug for you.

H

1 Like

Yes, I’m setting this on the old domain which is pisysmarine.com and it’s the only rule in there.

Here’s a screenshot in case it’s useful.

What I really need is a general rule that redirects anything at pisysmarine.com to our new domain at triton-soft.com but I really want the additional rule so that if someone has our old downloads link, it send them to the right page on our new domain. I thought I’d try to get the download bit working first and I’ve not tried the other part yet.

Thanks again

1 Like

Well, this is weird, I just tried it on a new browser and it’s working as you suggested it would. That’s using Edge on a PC.

However, when I use Chrome on my Mac it still gets it wrong although Safari on the Mac gets it right.

I have deleted all the growing data from Chrome and now that’s working too. So it looks like there was something stored in Chrome causing the problem.

Thanks for your help.

*browsing data.

To redirect the rest of the website create a new “Redirect to a Different Domain” rule

  • Give the rule a name “Catch-all”
  • Apply the rule to “All incoming requests”
  • Set the URl redirect to Static and the URL to https://triton-soft.com/ and use 301 Status code
  • Make sure that you select Last in the place at order

This rule will redirect any requests to https://www.pisysmarine.com/ to https://triton-soft.com/.
As it is a static rule it will redirect everything to the new domain and ignore the URI.

Also, as the rule for downloads in before this catch all rule, the downloads redirect will not be affected.
If you want to create a rule for a specific old page to a given new page follow the same instructions as for the downloads page, just make sure the rule is before the Catch All rule.

2 Likes

That’s very helpful. Thanks very much.

1 Like

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