wordpress - https redirect in .htaccess doesn't work on homepage -


i've activated ssl on website (https://ledertid.com)

i use in .htaccess redirect http:// https://.

this original .htaccess

# begin wordpress  <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>  # end wordpress 

then tried (option a)

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /  rewritecond %{env:https} !=on rewriterule ^.*$ https://%{server_name}%{request_uri} [r,l]  # begin wordpress  rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>  # end wordpress 

the above option returned following error in browser: "ledertid.com redirected many times."

then tried (option b)

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /  rewritecond %{https} !=on rewriterule ^.*$ https://%{server_name}%{request_uri} [r,l]  # begin wordpress  rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>  # end wordpress 

option c

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /  rewritecond %{https} !=on rewriterule ^ https://%{http_host}%{request_uri} [l,r=301]  # begin wordpress  rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l]  </ifmodule> 

it works charm on url's except homepage. if visit http:// ledertid.com doesn't redirect https:// version.

is wrong rewrite rules in .htaccess or missing else causing problem?

thanks bunch in advance.

you can use in .htaccess:

rewriteengine on  rewritecond %{https} !=on rewriterule ^.*$ https://%{server_name}%{request_uri} [r,l] 

this force https on every page including homepage.


Comments