How to force www/non-www for your site with .htaccess

Many people wish to force wither the www or non-www version of their site no matter how the user typed it into their browser. This can easily be done within your .htaccess file if you host on an Apache web server. This video walks you through that process using cPanel.

First log into your cPanel and use your File Manager to navigate to the folder where your .htaccess file lives.

Locate the file and open it for editing.

Once you have the file open you can enter the code to either force www or force the non-www version of your site.

Be sure not to have code for both in the file as it will cause a redirect error and your site will not work.

Once you enter the desired code, save the file. Now you can visit your site and test it. It should always redirect to the version you selected no matter how it is typed in.

For more information on how to force www or non-www, please see our article on the subject.

InMotion Hosting was founded in 2001 and provides personal and business web hosting for everyone! For more information about InMotion Hosting and the services we provide see here:

Duration: 6:4
Publisher: InMotion Hosting
You can watch this video also at the source.

Inxy Hosting CDN Marketplace