Redirect from page.mysite.com to mysite.com/page

I need to redirect like anything.mysite.com to mysite.com/anything . How can I do that?

I tried inside Page Rules but didnt work!

Use redirect rules. Redirect when hostname equals anything.example.com to a dynamic rule, kind of like this…

concat("https://example.com/", substring(http.host, 0, len(http.host) - len("example.com") -1))

(That’s just off the top of my head, may not work, but gives you the basic idea of chopping up the request and reforming it to get what you want).

See…

You will also need a DNS entry for every anything - if that is truly anything, you’ll need a wildcard * entry to match anything. Just use A 192.0.2.1 or AAAA 100:: in the DNS as dummy values for the subdomains/wildcard.

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