I apologize in advance for my novice understanding with Traefik, but is there a way to rewrite to "non-www" domains with a request-based variable?
I've been Googling for over an hour and cannot find an answer.
Here is an example how I would do this in Apache. You can see it is using the HTTP_HOST variable:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
I can see that I can set labels like so:
--label "traefik.frontend.redirect.permanent=true"
--label "traefik.frontend.redirect.regex=^https?://www.example.com/(.*)"
--label "traefik.frontend.redirect.replacement=https://example.com/${1}"
But this requires me to set example.com for everything. I would like this to redirect regardless of the domain. Thanks!