Creating a 301 Redirect

Discussion in 'Site Design, SEO, Google and Site Promotion' started by RodClaar, Jun 8, 2009.

  1. My SEO consultant says that I need to create a permanent redirect (301) from the www to the non-www domain name. I understand that this requires code, but where do I put it? Should I just put it in the top of my default page and if the user came in to the www domain, it would redirect to itself?
     
  2. mjp

    mjp

    In IIS 7 I believe you can use the URL rewrite module to do that, but in IIS 6 it's a bit more complicated. If you are using .NET code you can specify the status and header info.

    Your SEO consultant should have also suggested opening up an account at Google's Webmaster Tools. Once in there you can tell Google not to index your site using the www (or vice versa). That way any links in to your site coming from Google search would enter without www.
     
  3. yes it should go at the top of your default page.

    It should look something like this...

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.new-url.com/"
    %>
     

Share This Page