Forward Subdomains To Root Domain

I want to forward all of my subdomains to my root domain.

For example:
anythinghere.example.com > example.com/anythinghere

How can this be done please? Note that I do not want existing DNS records to be affected by this.

You’ll need to use the regex_replace function, which is available on Business and Ent plans. You can try a Redirect Rule with type Dynamic and Preserve Query String checked:

When:

http.host ne "example.com"

concat("https://example.com/",regex_replace(http.host,".example.com",""),http.request.uri.path)

1 Like