0

I'm trying to rewrite using htaccess all traffic over SSL (https). However my certificate gives an error on mobile, so I Want mobile traffic to go over the normal http protocol.

This is my htaccess:

<IfModule mod_rewrite.c>
    #Options +FollowSymlinks
  # Options +SymLinksIfOwnerMatch
    RewriteEngine On
  # RewriteBase /
</IfModule>
<IfModule mod_rewrite.c>
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
 <IfModule mod_rewrite.c>
    RewriteCond %{SERVER_PORT} !^443
    RewriteRule ^ https://ugaris.com%{REQUEST_URI} [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
 </IfModule>

Just to be clear:

mobile -> http rest -> https all -> non-www

  • Don't see how it is a duplicate I'm afraid x.X But that is a very informative article, I'll see what I can find there! – Edwin de Jong Oct 21 '14 at 11:35
  • It is a **canonical** article. Those are articles where the community has said all it is going to say on a class of subject, because although everyone's particular problems in that class are somewhat different, to the extent that they are interesting, they aren't different, and to the extent that they're different, they aren't interesting (to anyone save the questioner). So we write one answer that's designed to be the last word on the subject, and say no more. I'm not authoritative, though; several other locals will have to agree with me before your question is closed. – MadHatter Oct 21 '14 at 13:44

0 Answers0