0

I'm using Cloudflare's SSL on Flexible (Free) and it works perfectly fine. I have setup all files and links from https:// to // to make them work over https.

I have also set the following in my .htaccess file to make any client go from http to https automatically:

RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ - [env=askapache:%2]

The issue with the .htaccess code is that it only changes http to https on the root index file of my site for example, http://example.com/index.php will redirect to https but http://example.com/folder/index.php wont.

My second issue is even if I do a simple href="https://example.com/folder/index.php" or href="//example.com/folder/index.php" it will just bring me to the basic http url.

1 Answers1

0

If you are using CloudFlare, you can define to always use SSL in the page rules.


For .htaccess (recursive):

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Richard
  • 2,840
  • 3
  • 25
  • 37
  • How can I define to always use SSL via page rules? – Yuuki Asuna May 30 '15 at 18:46
  • @YuukiAsuna: See the help of [CloudFlare](https://support.cloudflare.com/hc/en-us/articles/200168306-Is-there-a-tutorial-for-Page-Rules-). For the loop: very crazy. What does the server logs say? – Richard May 30 '15 at 20:39