Views:

Excel To HTML using codebeautify.org

Important: This article applies to Web.com customers only.

Installing the Non-WWW 301 Redirect on an Apache (UNIX) Server

Follow these steps to get started with the installation:

  1. 1. Ensure that your hosting provider has turned on the Apache Rewrite Module.
  2. If it is not turned on, then you will not be able to install the redirect properly.
  3. 2. Download the .htaccess file from your website’s Root Web folder. Make sure to place the file in a folder where you can edit the file later on.

    Note: Make a duplicate copy and save it in another file, in case you need to revert to the original file.

  4. 3. Open the version that you are going to edit and install using Notepad.
  5. 4. Add the following code to the .htaccess file. Replace  example.com with your website's domain name:
  6. RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
  7. 5. Save the file and upload it back to your website, placing it in the same folder/file from which you downloaded.
  8. 6. Open a browser and try visiting the non-www version (example.com) of your website.
  9. If the .htaccess file is working properly, you will be redirected to the correct version of your website.
  10. Note: We recommend that you use the site Stepforth to ensure the redirect is working. Enter your non-www website address into the HTTP Header Check. If the redirect is working correctly you will see similar results, in red. in the following example:

  11. #1 Server Response: http://example.com
    HTTP Status Code: HTTP/1.1 301 Moved Permanently

    Date: Wed, 14 Mar 2007 22:49:28 GMT
    Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
    Location: http://www.example.com/
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    Redirect Target: http://www.example.com/#2 Server Response: http://www.example.com/
    HTTP Status Code: HTTP/1.1 200 OK

    Date: Wed, 14 Mar 2007 22:49:28 GMT
    Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
    Connection: close
    Content-Type: text/html

  12. If the redirect worked, then you are finished with the installation. If it didn’t work, then you will need to restore the backup .htaccess file and then review the revised .htaccess, comparing it to the information above and checking for mistakes.

  13. For more troubleshooting activities, SEO-related, on how to update your website, please refer to the Related Articles.