Cloudflare has recently introduced so-called transformation rules, with a limit of 10 rules per free account. They offer greater flexibility than redirect rules, and importantly they do not impact HSTS as they kick in after the connection is upgraded to SSL (unlike redirect rules which cause issues with HSTS). Regex support is particularly welcome.
I wonder whether it's possible to create a rule that would rewrite (or redirect) the URLs in the following manner:
https://$1.example.$2
where
$1 is one of "calendar", "drive", "groups", "mail", and "sites", and
$2 is one of "com", "net", and "org"
is rewritten or redirects to:
https://$1.google.com/a/example.$2
The purpose is to replicate the handy functionality of Google Workspace which allows its core services to be accessed using subdomains to custom domain (http://calendar.example.com
, etc.). Unfortunately, Google's solution does not work with SSL connections; hence this question.