How to: Redirect Non-WWW to WWW using .htaccess


1) Login to your cPanel
2) Click on File Manager
3) Open "public_html" folder and create a .htaccess file [You can also create it inside to any other directory.]
4) Include any of the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

# Don't forget to replace domain.com with your domain name.

5) Click the Save Changes button to save your changes.


Was this answer helpful?

 Print this Article

Also Read

How To Access Temporary URL From cPanel

If you don't wish to change your domain's name servers and wants to check your your website with...

How to create a phpinfo.php page?

In order to see the information about PHP version, compilation options and extensions, you will...

How to: Redirect WWW to Non-WWW using .htaccess

1) Login to your cPanel2) Click on File Manager3) Open "public_html" folder and create a...

How to increase the maximum upload size from cPanel

To increase the maximum upload size from cPanel, follow these steps:1) Login to your cPanel2)...

How to disable directory listing from cPanel

To disable directory listing / browsing from cPanel, follow these steps:1) Login to your cPanel2)...