SSL on Dreampress - multiple redirects

Hi all

I have followed the advice on setting up SSL on Dreampress on this article:

RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

In terms of adding the above to my .htaccess code, it creates multiple redirects which slows down the loading time, for example: --> 301 to 301 to -->

My wordpress settings are set to add ‘www.’ to all webpages. Is there anyway to get around this .htaccess code so that only one redirect is ever needed?

%{HTTP_HOST} basically just means “whatever hostname was in the request”. So replace %{HTTP_HOST} with your full domain name to make it redirect straight to the correct domain, e.g.

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .*{REQUEST_URI} [R,L]

Thanks Andrew, that seems to have worked OK, but now there is a 302 redirect rather than a 301 redirect in the below?: ->

Ah nevermind, figured it out…

RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule .*{REQUEST_URI} [L,R=301]