KB Article #167267
HTTP to HTTPS Redirect for Web Access Plus/ST Web Client HTML Skin
Problem
We would like to redirect all request coming to HTTP port to the HTTPS port. In the Operations -> Server Control page in the Admin GUI we can see that the HTTP Server is running for both plain text HTTP and HTTP over SSL.
Resolution
When end user HTTP connections are made to the ST server, the ST HTTP service presents the user with the login.html page of the default HTML template configured under Setup -> Miscellaneous Options. You need to see what your current setting for the default HTML Template is, in order to edit its login.html file accordingly as shown below.
This is a list of the locations of the login.html file for each of the HTML templates provided with ST. If you have a custom built HTML template, you can find the login.html file at
<FILEDRIVEHOME>/share/ftdocs/html/skin/<your_html_template_name>/C/login.html
| Axway Jelly Ball 9 | <FILEDRIVEHOME>/share/ftdocs/html/skin/jb9/C/login.html |
| Axway Box and Stripe in Blue | <FILEDRIVEHOME>/share/ftdocs/html/skin/sm6/C/login.html |
| SecureTransport Legacy Client | <FILEDRIVEHOME>/share/ftdocs/html/C/login.html |
| SecureTransport Web Access Plus (ST versions before 5.3.3) | <FILEDRIVEHOME>/share/ftdocs/html/skin/ric/C/login.html |
| ST Web Client (ST versions 5.3.3 and above) | <FILEDRIVEHOME>/share/ftdocs/html/skin/ric/C/login.html |
Open the login.html file of your HTML template with your favorite text editor. Add the following code after the "<title>...</title>" element located near the top of the file.
<script language="JavaScript" type="text/javascript">
if (location.protocol == "http:") {
location.replace('https://' + location.hostname + ':443' + location.pathname);
}
</script>
NOTE: If you are using a different port other than 443 for the HTTPS connection (check the Operations -> Server Control page for the actual port number you use), use it in the above code snippet replacing 443.
No restart of services is required. The change should be effective after you reload the web page in the browser.
IMPORTANT: The following solution has been tested with the default value of the Http.FdxAuthReply Server Configuration option, i.e. HTML (or Form Authentication). This solution is either not tested with the other HTML authentication methods or known not to work, as is the case with BA (Basic Authentication).