I am using IIS which takes up ports 80 for HTTP and 443 for HTTPS.
I also have XAMPP 1.8.1 installed, and can access the content served by Apache via port 8080 for HTTP, and port 444 for HTTPS.
I have been looking at trying to see how I can redirect all Apache traffic to go direct to HTTPS.
I tried the advice here: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
Using .htaccess - e.g.
- Code: Select all
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context
But I think in my case things are complicated by the fact I have to redirect e.g.
http:8080//example.com/ to https:444://example.com/
I can't work out how I would do that - is it possible? I tried adding in port 444 via this:
- Code: Select all
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https:444//%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context
However, doing that redirected this:
http://example.com:8080/
to this in the address bar:
http://example.com:8080/C:/xampp/htdocs/https:444//example.com
Is it possible to do what I'm trying to do?
Thanks