Results 1 to 2 of 2

Thread: Add the 'www' prefix to my domain

Hybrid View

  1. #1
    Join Date
    Sep 2010

    Add the 'www' prefix to my domain

    I have a site designed in .net and was wondering how to Automatically Add the "www" Prefix to my domain?

    I noticed certain websites have it (Apple.com, MySpace.com, Sitepoint.com). So if a user types in yourdomain.com or any subpages like yourdomain.com/exec-bios/ it would automatically add the 'www' to the prefix

  2. #2
    Join Date
    Jul 2009
    You can do this by adding a .htaccess file to your site's home directory(e.g. publice_html).

    Then you can force all requests to the non-www version of your url to go to the www version. Just add this code to the blank .htaccess file.

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.your_domain.com$
    RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]
    Make sure to change the above urls to your domains' url. There are probably lot's of references floating around google you can check out for this too.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center