Need help with redirect that does not redirect other port numbers

Hi I’m trying to set up a wildcard redirect using Redirect Rules like so:

URL wildcard *example1.com/

Dynamic ${1}example2.com 302

But this is also redirecting traffic from https://subdomain.example1.com:2083/ which is what I’m trying to avoid. I don’t have any other redirect or page rules on example1.com domain.

It’s also important that I don’t redirect anything except for requests for the root path.

May I ask if you need to access over the 2083 on example1.com?
If not, you can block it completly for the main domain and all sub-domains, or only for particular sub-domain(s) via WAF Custom Rule.

You would have to use the Expression Editor to redirect if port is NOT 2083

http.request.full_uri wildcard "*example1.com/" and cf.edge.server_port != 2083

wildcard_replace(http.request.full_uri, "*example1.com/", "${1}example2.com/")

2 Likes

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