Our application needs to redirect HTTP
requests to HTTPS
.
Normally i would use the RewriteCond
as below.
RewriteCond %{HTTPS} off
The thing with our current hosting company is that the requested port is always 80. It doens't matter if we send a HTTP
or HTTPS
request, the $_SERVER['SERVER_PORT']
is always 80.
We can handle this in PHP
, but we also want to force files to HTTPS
.
So the concrete question. Is there anyway to force HTTPS
in .htaccess
without using RewriteCond
like RewriteCond %{HTTPS}
or RewriteCond %{SERVER_PORT}
.