Redirect from to

I have an ingress configured with host :
Can I redirect everything from the URL to ?


Hello @nowel.hermans,

What version of Traefik are you using?

Hi @daniel.tomcej ,

I am using traefik:1.7.19.
I found something that "nearly" works:

I use the following annotations: "true" "true" ^https://(|*)$2 "true"

Expected behaviour would be: ->
But I get this: ->. -> hit refresh ->
Which means opening the URL does not redirect from the first time, I need to perform a refresh (Cmd-R) in order to get redirected to the correct URL.

Any idea ? Or Traefik v2 would solve this issue more easily ?

Many thanks,

Hello @nowel.hermans,

your regex here: ^https://(|*)$2

Looks like it matches and redirects it to, which browsers will probably not process immediately due to redirect loops.

Try using: ^https://(*) instead, as it will only match on www.

Hello @daniel.tomcej ,

That fixed my issue ! And it make perfect sense to do it this way.

Many thanks for your help

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