301 redirect to new website

Discussion in 'General troubleshooting' started by Hugh, May 25, 2011.

  1. So I admit right off I have so little understanding of asp.net and of the way discountasp.net hosting works that I am not sure even how to ask the question properly.

    I am a web developer ( www.kallenweb.com ) and we have built a simple but beautiful new website for our client http://www.silversidesmuseum.org/index.htm who previously had a homemade one utilizing the cms interface at discountasp.net.

    I set up a simple redirect at www.glnmm.org which sends visitors to the new site with a 301 redirect.

    However there are subpages (no pun intended) still saved in google. The pages look like
    Code:
    http://glnmmorg000.web151.discountasp.net/apps/dnn/mydnn/Attractions/USSSilversides/tabid/60/Default.aspx
    I need a simple method to create a redirect so all the pages will return a 301 error and send the browser to http://www.silversidesmuseum.org/index.htm.

    I tried creating default.aspx with the code:
    Code:
    <script runat="server">
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.silversidesmuseum.org/index.htm");
    }
    </script>
    And saving it in /glnmmorg000/Apps/DNN/mydnn then deleting some of the pages but this returns an error rather than processing the redirect.

    Can someone have mercy on me and tell me what to do?

    Thank you.
     
  2. OK, so I resolved the issue, and I am posting it here for all to see.

    I created a default.aspx file and placed it in
    Code:
    /glnmmorg000/Apps/DNN/mydnn
    The file contained this exact code:
    Code:
    <script language='c#' runat='server'>
    private void Page_Load(object sender, System.EventArgs e)
    {
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.silversidesmuseum.org/index.htm");
    }
    </script>
    I had tried this earlier but kept getting an error. But searching for 301 and reading over dozens of posts and the answer was simple:

    Change the first line to what I have above from
    Code:
    <script runat="server">
    According to this it is working:
    http://www.internetofficer.com/seo-tool/redirect-check/

    Hope this helps someone else.
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    Glad you have it resolved.
     
  4. mjp

    mjp

    It will, thanks!
     

Share This Page