1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

301 redirect from non www to www

Discussion in 'White Hat SEO' started by georgegaskin, Aug 25, 2010.

  1. georgegaskin

    georgegaskin Registered Member

    Joined:
    Nov 28, 2009
    Messages:
    99
    Likes Received:
    8
    Location:
    Long Branch NJ
    301 redirect from non www to www

    Hi Guys I am Trying to 301 redirect from non www to www. for my site. I want to get all my backlinks going to one place and be more SEO friendly. I have goggled and read and read but I am still confused. Hope you can point me in the right direction.
    My site is hosted on godaddy on a windows server
    and here is a code I found on Google, Not sure if this is what I need. There seems to be a lot of ways to do this.


    http://example.com:< %@ Language=VBScript %>
    < %
    Response.Status=?301 Moved Permanently?
    Response.AddHeader ?Location?, http://www_example_com
    %>

    and put this in the head? Thanks in advance
     
  2. summertime1

    summertime1 Junior Member

    Joined:
    Jun 11, 2010
    Messages:
    130
    Likes Received:
    22
  3. georgegaskin

    georgegaskin Registered Member

    Joined:
    Nov 28, 2009
    Messages:
    99
    Likes Received:
    8
    Location:
    Long Branch NJ
    Thanks Hirnhamaster I saw that yesterday,I must be a little thick.So I just past the asp code in my site on the index page only and done?

    Installing the Non-WWW 301 Redirect on a Microsoft IIS Server
    Microsoft servers do not have a .htaccess file to alter so we suggest that you contact your hosting provider and request they make this change for you. If they are baffled or need further instructions on how to make the changes you can refer them to the tutorials referenced below:
    1. Using Internet Services Manager create a new IP-based website using the http://example.com URL or alternatively you can avoid using a unique IP by using the host header (virtual website) of www.example.com.
    2. Now verify the server headers for each website using the Server Header Checker. The server response should be 200 OK for both addresses.
    3. Now add your domain-revised version of the following ASP code to the default home page for http://example.com:< %@ Language=VBScript %>
      < %
      Response.Status="301 Moved Permanently"
      Response.AddHeader "Location", http://www.example.com
      %>
    Note: do not change the spacing or line placement within the above code; place it as is.
    1. Once the default page is online first visit your website via http://example.com to ensure the redirect is working. Next check the server headers for http://example.com and make sure you see the following code within #1: "HTTP Status Code: HTTP/1.1 301 Moved Permanently". That code will confirm the 301 redirect is being properly communicated.
     
  4. summertime1

    summertime1 Junior Member

    Joined:
    Jun 11, 2010
    Messages:
    130
    Likes Received:
    22
    are you even using a windows server or is it an apache?
     
  5. georgegaskin

    georgegaskin Registered Member

    Joined:
    Nov 28, 2009
    Messages:
    99
    Likes Received:
    8
    Location:
    Long Branch NJ
    No I am using a windows server,I realize that code is for apache,now.I have another site on godaddy hosted on lynix server and they offer a 301 redirect but I am have a difficult time redirecting n www to www. QUESTION can I use my domain forwarding to do this on will that SEO and backlinks? Forwarding is easy to do.