It’s fairly easy. You just need to edit the .htaccess file in your public_html directory and add this to the top:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
You can edit the .htaccess file using the file manager in your hosting control panel (cpanel)
If you want to redirect http://www.example.com to http://example.com add this to the top of your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*)$ http://example/$1 [R=301,L]
If you have any questions or problems comment below or contact support. We’re happy to help.