So I have a Spring website which is https://
. At one point I need to redirect a user from a link clicked on my site to an http://
site. I'm doing this with a click on https://mywebsite.com/redirect/some-key.
In my Java backend, I'm taking the some-key
and redirecting the browser to an http://
link with return new ModelAndView(new RedirectView("http://somewhere.com", false, true));
(false referring to relative context, true referring to http10Compatible).
Instead of redirecting to the http://somewhere.com
site, it redirects to https://somewhere.com
.
I know there should be a straightforward way to do this, just feel lost currently.