0

I have query regarding setup of https to java application.. I have create load balancer for elastic beanstalk and give permission to security group handle traffic to https enter image description here

But when I write domain with https://www.example.com .it works with https,but when I type domain name webpage open but without https. My question here is should i write .htacces code or something else in java web application to achieve automatically come https green lock when I enter domain name only? please help I got stuck here. I am very new to aws.

Chanda Korat
  • 2,453
  • 2
  • 19
  • 23
  • Does the Java app have redirects in it? – strongjz May 23 '17 at 14:54
  • can you please more specific? i have route traffic of loadbalancer listners and security group?? java app redirects it i am not getting it.. u mean .htaccess?? – user7239901 May 24 '17 at 07:38
  • It sounds like you have a redirect in your Java code or on the apache server its self. Here is an example answer about keeping the protocols the sames https://stackoverflow.com/questions/3634101/url-rewriting-for-different-protocols-in-htaccess#3636461 – strongjz May 24 '17 at 12:40
  • code is not working in java ------ >>>RewriteCond %{HTTP_HOST} ^www\. RewriteCond %{HTTPS}s ^on(s)|off RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www\.)?(.+)$ RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L] – user7239901 May 30 '17 at 04:51

0 Answers0