Home Redirect non-www(http) and www(http) to https://www
Reply: 0

Redirect non-www(http) and www(http) to https://www

user614
1#
user614 Published in May 20, 2018, 12:00 pm

I am trying to do a redirect from non-www(http) and www(http) to https://www but it does not work. Need the following to work. Please help

  1. http://example.com redirect to https://www.example.com
  2. http://www.example.com redirect to https://www.example.com

Current htaccess file

rewritecond %{http_host} ^example.com [nc]

rewriterule ^(.*)$ https://www.example.com/$1 [r=301,nc]

Tried below rule

RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307385 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO