0

My website is runs on Tomcat 70.0.30 and Apache, all the pages are jsp so I think almost everything actually go to tomcat. I'm using http but I need https so I assume if I get SSL certificate and configure tomcat accordingly suddenly all my pages will now be dispalyed as https:... rather than http:.. and if I go to the http page I will just get 404 page not found.

But I need the http pages to redirect to the https ones, so how do i do this, where do i put the http redirects, in tomcat, apache or somehwere else. Note I dont currently configure anything in apache, it just works.

Eugène Adell
  • 3,089
  • 2
  • 18
  • 34
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • 1
    possible [duplicate](https://stackoverflow.com/q/23805402/7748072) – Eugène Adell Feb 05 '19 at 21:04
  • 1
    Is it an Apache HTTPD that forwards requests to Apache Tomcat via AJP protocol? If so you'll have to set the appropriate target redirect port on the `AJP connector` in your `server.xml`. Additionally set `CONFIDENTIAL` in you web application `web.xml`. This forces connection attempts on HTTP to redirect to HTTPS. See [this Q/A](https://stackoverflow.com/questions/7790141/is-security-constraint-configuration-for-tomcat-mandatory) also. – Selaron Feb 05 '19 at 21:36
  • Ah so its easy to do for whole website, great I weas lead to believe from another answer that yo would have to create individual redirects for every page ! – Paul Taylor Feb 06 '19 at 07:32

0 Answers0