wordpress - How to redirect a HTTP site to HTTPS site using 301 redirect instead of 302 -
i have woocommerce website using https. https if being redirected using 302 redirect , need change 301 redirect. have "force ssl (https) on checkout pages (an ssl certificate required)." option checked in woo commerce settings , htaccess file below
what's best way change 302 301 redirect?
# 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 # forcing https rewriteengine on rewritecond %{server_port} 80 rewriterule ^(.*)$ https://www.aransweatersdirect.com/$1 [r,l]
keep .htaccess this:
# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{server_port} 80 [or] rewritecond %{https} off rewriterule ^ https://%{http_host}%{request_uri} [r=301,ne,l] rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress
then make sure keep https
in home , site url of wordress permalink settings.
Comments
Post a Comment