You may also like to read:

In this tutorial I will show you how to redirect non-www to www using htaccess file.

For example, redirects to and redirects to

# Redirect non-www to www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Thanks for reading.

Leave a Reply

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