I have classic Spring Boot application on my VM. A user can go to https://www.fakeurl.com which is pointing to my VM , or, a user can go to https://fakeurl.com which is pointing to my VM.
The problem is that this is bad for SEO. When a user goes to https://www.fakeurl.com (with www) I need to automatically redirect him to non-www domain https://fakeurl.com
How can I do this in SpringBoot?