Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess - redirect to https not working
    primarykey
    data
    text
    <p>Per: <a href="https://exp-resso.com/blog/post/2011/08/securing-your-expressionengine-website-with-https" rel="nofollow">https://exp-resso.com/blog/post/2011/08/securing-your-expressionengine-website-with-https</a></p> <pre><code>RewriteEngine On RewriteCond %{HTTPS} off RewriteCond $1 ^(member|account|checkout|system) [NC] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </code></pre> <blockquote> <p>This tells your server “If HTTPS is off, and the request starts with member OR account OR checkout OR system (not case sensitive), redirect to <code>https://current-domain/current-page</code>”. It’s a nice simple method of locking down entire subfolders / template groups.</p> </blockquote> <p>I've added this to my htaccess file like this:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteCond %{HTTPS} off RewriteCond $1 ^(sign-in|sign-up) [NC] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] &lt;/IfModule&gt; </code></pre> <p>However, when I go to my <a href="http://mydomain.com/sign-in" rel="nofollow">http://mydomain.com/sign-in</a>, the URL doesn't change to <a href="https://mydomain.com/sign-in" rel="nofollow">https://mydomain.com/sign-in</a>. Any idea what's wrong?</p> <p><strong>EDIT 1:</strong></p> <p>My htaccess also has the following (to remove "www") and I wonder if having both might be causing the problem?</p> <pre><code>RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] </code></pre> <p><strong>EDIT 2:</strong></p> <p>Process of elimination, it turns out this is causing the problem:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On # Removes index.php from ExpressionEngine URLs RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] &lt;/IfModule&gt; </code></pre> <p>When I comment out the RewriteRule, the https:// is forces. <strong>What's causing the conflict?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload