redirct 404 visitors in aspx

Discussion in 'C#' started by login, Aug 22, 2007.

  1. #1
    Hi.
    i normally use .htaccess to automatic redirect 404 visitors to my home page. But now there is a site on a windows server that needs to do the same. How can I automatic redirect 404 visitors to my home page?
     
    login, Aug 22, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is done in the web.config or global.asax files - normally the web.config

    <customErrors mode="On">
    <error statusCode="404" redirect="error.html"/>
    </customErrors>
     
    AstarothSolutions, Aug 30, 2007 IP
    login likes this.
  3. yugolancer

    yugolancer Well-Known Member

    Messages:
    320
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #3
    AstarothSolutions is allright but also you can set up that on error 404 all users are redirected to certain page through the control panel.
    Control panel that comes with the any hosting plan you buy from any Hosting provider.
    I believe that all CP's support this feature. Correct me if i am wrong.
    But just in case you better stick to the AstarothSolutions's solution.

    Regards :)
     
    yugolancer, Aug 31, 2007 IP
    login likes this.
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Most control panels do have the option for custom error redirection but not all - Helm (the most common on Windows servers I believe) has it as an optional component and for the hosting we sell it is disabled as standard, namely as we provide web.config redirection and sell very very little stand alone hosting - dont want users playing with the control panel and causing problems which we have to fix :)
     
    AstarothSolutions, Aug 31, 2007 IP
  5. yugolancer

    yugolancer Well-Known Member

    Messages:
    320
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #5
    I agree with that too. I was just offering something else to try.

    Regards :)
     
    yugolancer, Sep 1, 2007 IP
  6. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hey, editing your post after I respond is cheating ;)

    Wasnt correcting, but your original post made a good suggestion but queried if it was available for all control panels, for the benefit of others we were just clarifying that part
     
    AstarothSolutions, Sep 2, 2007 IP