Reputation: 39
Using .htaccess, I need to redirect all requests from
to
Thanks,
Upvotes: 0
Views: 49
Reputation: 41219
To redirect to https://www
you can use :
RewriteEngine on
RewriteCond ℅{HTTPS} off [OR]
RewriteCond ℅{HTTP_HOST} !^www\.
RewriteRule .* https://www.example.com℅{REQUEST_URI} [NE,L,R=301]
Upvotes: 0
Reputation: 120
copy this to your .htaccess file.
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteCond %{HTTP_HOST} ^(www.example)?.com$ [NC]
RewriteRule ^$ http://www.example.com%{REQUEST_URI} [R,L]
Upvotes: 1