How to redir wildcard subdomains to www

Hi and Merry Xmas:
My current redir to be imported to caddyfile is below

geoip /etc/caddy/GeoLite2-City.mmdb
redir { # geoip
if_op and
if {geoip_country_code} not_match US
if {geoip_country_code} not_match GB
/ https://www.{host}
}

So I can redirect example.com to www.example.com.
Now I would like to redirect wildcard *.example.com to www.example.com.
thanks you for help in advance.

Resolved.
I changed to
/ https://www.{label2}.{label3}{uri}
by looking at this post
Universal redirector - #2 by Whitestrake

1 Like

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