5

I am forwarding my http traffic to https with a .htaccess file like this:

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

This works everywhere except on iOS safari. When I go to the http address on iOS safari, the browser hangs because there is no where to go with http.

What can I do to forward http to https on iOS Safari?

Atma
  • 29,141
  • 56
  • 198
  • 299
  • Does it come up with an error message at all? – Joe Jul 01 '16 at 20:58
  • @thickguru It says: "safari could not open the page because the server stopped responding. – Atma Jul 01 '16 at 21:06
  • Take a look at this @atma [link](http://stackoverflow.com/questions/10196783/https-request-cant-verify-certificate-on-ios-safari) might help. – Joe Jul 01 '16 at 21:08
  • @thickguru my cert is fine, my site loads no problem when I go straight to https. The problem is when I go to http, the redirect does not happen. – Atma Jul 01 '16 at 21:17

1 Answers1

1

The problem was that the .htaccess didn't have a 301 redirect. Once I added that, everything redirected smooth:

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
Atma
  • 29,141
  • 56
  • 198
  • 299