.htaccess - How to redirect to https my domain with current htaccess settings? -
i'm new htaccess file, , current configuration follows:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>
now, find out if want redirect https, need use following:
rewriteengine on rewritecond %{https} !^on$ rewriterule .* https://%{server_name}%{request_uri} [l,r]
my question should put these lines? can delete current configuration? greatfull can explain current configuration does, or @ least point right direction.
solved issue adding code @ top of .htaccess
<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{server_port} !^443$ rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] </ifmodule>
this let's serve static content (css, images) through https
Comments
Post a Comment