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
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
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]
# 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]
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.
Should I change something in your code ? I pasted it exactly as you wrote it.
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]
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.
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?
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?
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.