Page Rule Forward URL

Trying to make a Page Rule:

Need to redirect (forward) the following URL that contains a query string:

https://www.domain.com/map-location/location-name/?mpfy_map=5273&mpfy-pin=7951

to: https://www.newdomain.com/teacher/teacher-name/

I have also created a 301 redirect in my newdomain website:

redirect 301 /map-location/location-name/?mpfy_map=5273&mpfy-pin=7951
https://www.newdomain.com/teacher/teacher-name/

I can’t quite get my page rule to work though (set up on domain1) .

Right now I have:

*.domain1.com/map-location/*/?mpfy_map=*&mpfy-pin=*

Forwarding URL (Status Code: 301 - Permanent Redirect, Url: https://www.domain2.com/$3)

But it doesn’t quite work.

Any guidance for me here much appreciated.

Please edit your post and use </> or backticks to set your expression as code, so that users in the community can see your expression correctly. Otherwise * turns text into italics.

Thanks – I think I fixed that now.

1 Like

What exactly is not working? Is there a redirect but to a different destination? Or the rule is not triggering? Please keep in mind that PRs are processed in order, and only one PR triggers per URL, so you’d have to place this redirect before other generic redirects that apply to the whole zone or domain.

In your examples, is " newdomain" the same as " domain2"?

As written, you’d have a redirect to
https://www.domain2.com/[number-following-mpfymap]
and not
https://www.domain2.com/teacher/teacher-name/
as you apparently wants.

Thanks for that.

I now think I might not even need Cloudflare page rules to do what I want – that is to say that my main global page rule (URL forward) may be doing it’s job, and that I need to address this in the DOMAIN2 htaccess file.

Thanks agin!

1 Like