Help With Domain 301 Redirect WWW to non-WWW

Discussion in 'Domain Names' started by ashivapu, Dec 3, 2009.

  1. #1
    I tried search all over this forum, but couldn't find a solution that met my needs (or so I thought).

    I have one domain - http://domain.com

    I would like to create a 301 redirect so everything under that domain (including folders) with a www. will get redirected with no www.

    I have tried some of the basic ones I have saw on here (can't find them anymore). They redirected the initial domain name, but not domain with folders.

    Example:
    It redirected http://www.domain.com to http://domain.com
    but it did not redirect
    http://www.domain.com/two-words to a non-WWW

    I used two-words because the folder has two words like that.

    Thanks in advance!
     
    ashivapu, Dec 3, 2009 IP
  2. SiberForum

    SiberForum Banned

    Messages:
    1,536
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    80
    #2
    That can be done as on the server side as in your htaccess file:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule ^(.*) http://www.domain.com/$1


    Use what you need instead of domain.com
     
    SiberForum, Dec 4, 2009 IP
  3. ashivapu

    ashivapu Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks that worked
     
    ashivapu, Dec 4, 2009 IP