CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • 301 Moved Permanently

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    175
  • Date Created
    Friday, July 13, 2012
  • Last Updated
    Friday, July 13, 2012
  • This Article Has been Viewed
    1528 times
  • Short Desc
    When you change your pages around, you do not want to leave a lot of dead links, this will cause you to have negative hits on your site, called 301 errors.
  • Details
    When your site has what is called: Dead link 301 Errors.
    This is not good for a webmaster to have, so what we do is create a 301 Moved Permanently script, that allows the search engine spiders to come in, and see that the page has been moved, and then to remove the link from it's database, and replace it with a working link, that we provide in code.

     

    The page you requested is NOT AVAILABLE
    A general error has occurred
  • Recreate Issue
    To recreate this issue:

    To recreate a page not being found, you need to remove it from your web server, once it is removed, click on the link to that page, and it will give you an error.
  • Resolve Issue
    To resolve this issue:

    This issue is very easy to resolve in ASP Classic.
    Place the following code in the <head> of your page, and run it.


    <%
    ' The src gets the Script_Name?QueryString
    scr = Request.ServerVariables("SCRIPT_NAME")&"?"&Request.ServerVariables("QUERY_STRING")
    if scr="main.asp?Oldid=3" then
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "main.asp?id=3"
    Response.redirect "main.asp?id=3"
    end if
    %>



    Alternative, to the above, which only works if you are dealing with QueryString.
    If you are dealing with plain pages, then you will just a single page, then you will do something like this.


    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "NewPage.asp"
    Response.redirect "NewPage.asp"
    %>