.htaccess - Redirection http to https and non-www to www -


i using code ssl migration:

rewritecond %{https} off rewriterule .* https://%{http_host}%{request_uri} [l,r=301]   rewritecond %{http_host} !^www\. rewriterule .* https://www.%{http_host}%{request_uri} [l,r=301] 

the problem facing is working redirection not working of folders , urls in few cases working , baffling me.

if code correct, should work every url on site instead of few or shouldn't work @ all. when remove first re-write condition in .htaccess, site works fine.

this error getting:

https/www.mysite.com:443/some-folder/xyz.html 

can help? in advance.

try this...

rewriteengine on rewritecond %{http_host} ^[^.]+\.[^.]+$ rewriterule ^ http://www.%{http_host}%{request_uri} [r=301,l] rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -