php - How do I redirect https:// to https://www on .htacess file? -


i modifying .htacess. tried changing https://mydomain.com https://www.mydomain.com code below. failed.

# redirect https:// https://www. rewritecond %{https} on rewritecond %{http_host} ^my___domain\.com$ [nc] rewriterule ^(.*)$ http://www.my___domain.com/$1 [r=301,l] 

what doing wrong?


as note:

if helps, redirect both ip , original 3_$ (_">http://my3_$.com) _">http://www.3__$.com used these codes in beginning, worked.

# redirect ip www. rewritecond %{http_host} ^xxx\.xxx\.xxx\.xxx rewriterule (.*) http://www.my___domain.com/$1 [r=301,l]  # redirect http:// http://www. rewritecond %{http_host} ^my___domain\.com$ [nc] rewriterule ^(.*)$ http://www.my___domain.com/$1 [r=301,l] 

i trying redirect https:// because after modifying 2 above successfully, unable log in, https:// pages.

thank you

instead of http://www.___.com/$1, use //www.___.com/$1. use http or https, whichever used in original request. currently, you're forcing http, seems opposite of want.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -