Issue
I setup SSL to my web application. Standard port for this application is 8080, and SSL port is 8443. I have a problem with Apache httpd configuration. I want to redirect all urls listed below:
http://1.2.3.4:8080
https://1.2.3.4:8080
http://1.2.3.4:8443
to this url:
https://1.2.3.4:8443
I changed httpd.conf to this:
Listen 1.2.3.4:8080
<VirtualHost *:8080>
ServerName 1.2.3.4
Redirect "/" "https://1.2.3.4:8443"
</VirtualHost>
It works fine for the first url listed above, but it does not for other urls. I tried different configurations but they did not work. Can anyone help with me with this problem?
Solution
https://1.2.3.4:8080 http://1.2.3.4:8443
If HTTP is being served on port 8080 and HTTPS (SSL) is on 8443 then neither of the above URLs will be accessible in order to be able to trigger a redirect. (?!)
In your config HTTP is only port 8080 and HTTPS is only port 8443.
Reference:
https://serverfault.com/questions/359461/apache-answer-both-http-and-https-on-the-same-port
Answered By - MrWhite Answer Checked By - David Marino (WPSolving Volunteer)