We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.
Contact Us
Contact Us
Sign in
Sign in
Nexcess Logo

How to redirect a non-WWW web address to a WWW web address

September 10, 2019

How to redirect visitors that specify a non-WWW web address to a WWW web address. 

ATTENTION: If you do not have experience in working with .htaccess files, contact  our support team for assistance to avoid potential harm to your website. 

What you need

  • An existing, enabled .htaccess file for your domain. For instructions, refer to How to create .htaccess files
  • A back-up of your .htaccess file


  1. Open your .htaccess file located in your document root directory, /html.

  2. Copy and paste the code below into the file, but replace <example.com> with your actual domain name without the angled brackets.
    RewriteEngine On RewriteCond %{HTTP_HOST} ^<example.com> RewriteRule ^(.*) $ http://<www.example.com>/$1 [R=301,L]

For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

Jason Dobry