4

What is the best way to switch an existing Joomla site from http to https (SSL), technically and also from an SEO approach.

1st, i had a rule in my htaccess but it was not perfect :

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

So, i deleted the rule and discover that there was a simple "force SSL" option.

So i activated it and it seems to do the job.

But is it enough for SEO ?

Previously i was doing a redirect from non www to www like this :

RewriteCond %{HTTP_HOST} ^domain.fr [NC]
RewriteRule ^(.*)$ http://www.domain.fr.fr/$1 [L,R=301]

Should i let this rule with force SSL or not ?

3 Answers 3

3

Keep your .HTACCESS rule, but change it to:

RewriteCond %{HTTP_HOST} ^domain.fr [NC]
RewriteRule ^(.*)$ https://www.domain.fr/$1 [L,R=301]

In your configuration.php file, make sure these two lines are set:

public $live_site = 'https://www.domain.fr';
public $force_ssl = '2';
2
  • 1
    I’ve tested you rule and it seems to work (redirect from non www to www + https). Thanks. Nov 24, 2016 at 15:00
  • Great! Feel free to mark this as the solution. Dec 1, 2016 at 14:58
1

I use this chunk of .htaccess settings in the custom redirects section of Joomla's default .htaccess:

# redirect http to https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

It will work for any domain.

1

This is what I use in .htaccess. It first checks if http or https, then checks if www or non-www. It will work for any domain and forces all four url variants to same one (in this case https://www.)

######### CLIENT-SPECIFIC #########
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
######### END CLIENT-SPECIFIC #########

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.