This page looks best with JavaScript enabled

How to redirect non-www URLs to www?

 ·  ☕ 1 min read  ·  👽 john hashim

To redirect your website from non-www to www, add the following lines in your website’s .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Replace with your actual domain name.

Share on

john hashim
john hashim
Web Developer