beer9
asked on
Redirection rule for HTTP to HTTPS?
I am trying like this:
when I access http://54.10.10.10/app then first I see https://54.10.10.10:8443/app in my browser then I see URL changed as https://54.10.10.10/app. I would like to understand what is causing it to first show port 8443 then hiding it
RewriteCond %{HTTP:X-FORWARDED-PROTO} !https
RewriteRule ^(.*)$ https://54.10.10.10:8443$1 [L]
when I access http://54.10.10.10/app then first I see https://54.10.10.10:8443/app in my browser then I see URL changed as https://54.10.10.10/app. I would like to understand what is causing it to first show port 8443 then hiding it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your question was:
I would like to understand what is causing it to first show port 8443 then hiding it
Answer:
The cause of the show/hide is that you have manually specified the https port in your .httacces file
RewriteRule ^(.*)$ https://54.10.10.10:8443$1 [L]
so that the 8443 port is enforced upon first request, than the auto-redirect takes place and the port is hidden.
The 8443 port is the default SSL redirectPort to which is set the auto-redirection, you can see it in your config. And as I've mentioned in the earlier post:
If this Connector is supporting non-SSL requests, and a request is received for which a matching <security-constraint> requires SSL transport, Catalina will automatically redirect the request to the port number specified here. (redirectPort)
Optionally, you can take look at: A Simple Step-By-Step Guide To Apache Tomcat SSL Configuration
https://www.mulesoft.com/tcat/tomcat-ssl
I would like to understand what is causing it to first show port 8443 then hiding it
Answer:
The cause of the show/hide is that you have manually specified the https port in your .httacces file
RewriteRule ^(.*)$ https://54.10.10.10:8443$1 [L]
so that the 8443 port is enforced upon first request, than the auto-redirect takes place and the port is hidden.
The 8443 port is the default SSL redirectPort to which is set the auto-redirection, you can see it in your config. And as I've mentioned in the earlier post:
If this Connector is supporting non-SSL requests, and a request is received for which a matching <security-constraint> requires SSL transport, Catalina will automatically redirect the request to the port number specified here. (redirectPort)
Optionally, you can take look at: A Simple Step-By-Step Guide To Apache Tomcat SSL Configuration
https://www.mulesoft.com/tcat/tomcat-ssl
ASKER
Open in new window
and
Open in new window
and
Open in new window
What does it mean?