RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* ? [F,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTPS_HOST} !^www.website.com$ [NC]
RewriteRule ^(.*)$ https://www.website.com/$1 [L,R=301]
I used this to redirect:
- http to https
http://www to https://www both these work fine now. Yet I'm not able to redirect https://website.com to https://www.website.com
RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]
I tried this code changing http to https, but still it does not work. Is there anything that I'm doing wrong?