.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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -