Admin dashboard doesn't work in https

Permalink
To force https on my C5 website, I have added the following code in the .htacess file :

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*)http://mysite.com/$1 [R=301,L]

All is working fine for visitors. https is correctly forced, and everything works well.
But as an Admin, I cannot modify pages, save pages, see page details in the sitemap when in https.
And all works fine when I am in http

Is there a way to avoid this issue ?
Maybe putting an exception in the https redirection for mysite.com/index.php pages but I don't know how to code that.

Any idea ?

Thank you all for your help

 
JohntheFish replied on at Permalink Reply
JohntheFish
Assuming recent c5 version, you would set https in the canonical URL in the dashboard.

Setting the https redirect in the .htaccess but not in the canonical url is probably breaking ajax urls or falling foul of browser security.

So, try
- undo your .htaccess changes
- set the canonical url in the dashboard
- you probably don't want to re-add the .htaccess changes because c5 will take care of that for you.
enlil replied on at Permalink Reply
enlil
v8+, here is the .htaccess code I use. I never set canonicals in the dashboard and everything works nicely. Hope it helps!!

# Force https non www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^http://%1%{REQUEST_URI} [L,NE,R=301]
wollastoni replied on at Permalink Reply
enlil, I have tried your code but it doesn't force http in https

Should I change something in your code ? I pasted it exactly as you wrote it.
Steevb replied on at Permalink Reply 1 Attachment
Steevb
Typical set up for our sites.

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
RewriteCond %{HTTP_HOST} ^www\.jeansorchard\.uk$
RewriteRule ^/?$ "https\:\/\/jeansorchard\.uk\/" [R=301,L]
RewriteCond %{HTTP_HOST} ^77\.72\.1\.86
RewriteRule (.*) https://jeansorchard.uk/$1 [R=301,L]
wollastoni replied on at Permalink Reply
Thank you @steevb but when I go tohttp://jeansorchard.uk/ , I see that https is not forced. So your code doesn't seem to work.
Steevb replied on at Permalink Reply
Steevb
Sorry, how can you tell the sites are not forced?
Both ‘Jean’s orchard' and ‘Black dog games’ are fine!
http://blackdoggames.co.uk/
I do not have any problems with adding/editing anything while logged in?