linux - Apache HTTPS URL Rewrite -


i've started playing linux , apache , got stuck on this.

i have rewrite rule working fine:

rewriteengine on redirectmatch ^/$ /myserver/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /myserver/ [r] 

how can redirect https applying these same rules?

thanks!

on apache wiki:

rewritecond %{https} !=on # checks make sure connection not https  rewriterule ^/?(.*) https://%{server_name}/$1 [r,l] # rule redirect users original location, same location using https. # i.e.  http://www.example.com/foo/ https://www.example.com/foo/ # leading slash made optional work either in httpd.conf # or .htaccess context 

if understand question correctly, can implement in specific example.

note recommended use redirect inside non-secure virtualhost secure virtualhost.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -