i want to redirect http and www request to https

i want to redirect main domain http //, www request to https://
i added this code

Code (text):

RewriteCond %{HTTPS} off

# First rewrite to HTTPS:

# Don’t put www. here. If it is already there it will be included, if not

# the subsequent rule will catch it.

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Now, rewrite any request to the wrong domain to use www.

RewriteCond %{HTTP_HOST} !^www\.

RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

but it affect…
i want to redirect http and www request to https

See original post by donsr

Leave a Reply