How to redirect to a www subdomain with .htaccess


RewriteEngine on

RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) https://www.example.com/$1 [R=301,L]

Leave a Reply

Your email address will not be published. Required fields are marked *