One Caddyfile entry for www and without it

Using the latest caddy version from the Ubuntu PPA, are the only ways to support www and non www at the same time (For the same caddyfile domain entry) mean I would have to do the following or is there another way:

METHOD 1:, {
properties for this domain


I am asking since I would like to avoid redirecting from www to the non www and simply serve both on the same folder with the same information.

Your first example will serve both without redirecting to Caddy will manage separate certificates for the two domains.

1 Like

Thank you Francis, so it is how I understood it. What about saying that you want multiple subdomains pointing to the same place. For example would * work? to tell it all subdomains or any non existing sub domain to point it to the same place. How can I specify all subdomains except X one where it would be pointing to another place. I will assume I would add the X subdomain below the setup for the * yes?


If you use a wildcard though, you’ll need to configure the DNS challenge, and grab a build of Caddy with the appropriate DNS plugin.

This topic was automatically closed after 30 days. New replies are no longer allowed.