I want to force SSL for my site. It works with putting these 2 lines into .htaccess:
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
But when I try to login, it gives me this error:
Invalid form token. Please reload this form and submit again.
Without those lines in .htaccess, it works fine, but SSL is not forced.
Is there any other way to force SSL and to be able to log in?
Thank you.
[SOLVED]
I've changed '[R,L]' to '[R=301,L]', logged out - and now SSL works!
My .htaccess:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]Canonical URL is empty
- URS by SSL is 'https://example.com'
- Show only canonical URLs is ticked
RewriteCond %{HTTP_HOST} ^domain.com$ RewriteRule (.*) https://www.domain.com/$1 [R=301,L]Try that, who knows. Maybe it works... - Nicolai KrügerSystem & Settings->SEO & Statistics->URLs and Redirection, have you entered Canonical URLs? - Nicolai Krüger