1

How can I redirect non www URL to www URL in jboss using undertow.

Tried with the command below and it's going for too many redirects.

/subsystem=undertow/configuration=filter/rewrite=nonwww-to-www:add(redirect="true",target="https://www.localhost:8443%U")
/subsystem=undertow/server=default-server/host=default-host/filter-ref=nonwww-to-www:add(predicate="regex(pattern=^https://localhost:8443,value=https://localhost:8443,full-match=false)")
GeoSn0w
  • 684
  • 1
  • 9
  • 20
Anil kumar
  • 13
  • 3

1 Answers1

0

Not the same, this one focuses on HTTP to HTTPS in JBoss, but the accepted answer is pretty detailed, maybe it helps you:

https://stackoverflow.com/a/43752373/14076903

I quote:

"A rewrite rule can be used to redirect users. In the undertow subsystem (standalone.xml or domain.xml) you will need to create a new rewrite filter and then enable the filter in a new fitler-ref."

GeoSn0w
  • 684
  • 1
  • 9
  • 20
  • i have the question of what to use in regex expression of following. (predicate="regex(pattern=^https://localhost:8443,value=https://localhost:8443,full-match=false)") – Anil kumar Oct 12 '21 at 03:16