How to redirect Custom Error pages

Discussion in 'HTML / PHP / JavaScript / CSS' started by cosmoworlds, Nov 12, 2006.

  1. Hello,

    How should I redirect search engine visitors who arrive at a custom error page at our site to our homepage,
    use a .htaccess file for this?

    www.cosmoworlds.com is a simple html site, not ASP.

    Or is there anywhere I can read about this?

    Thank you,
    Frank
     
  2. .htaccess is only available on unix hosts.

    What URL are they landing at and where do you want it to go? You can send header request fairly simply in php.

    Check this out: www.php.net/header.

    or here's a simple php snippet:

     
  3. Ok, don't listen to Edified. He has no idea what he's talking about.

    If you want to redirect all 404 error (page not found) to your home page all you have to do is...
    • log into your control panel.
    • click on IIS Manager.
    • click on the Custom Errors tab.
    • In the 404 box, type the name of index page. (ie: default.html, index.html, etc.)


    If this is not what you want to do, please explain your desired behavior.





    I've also never seen DASP recommend a UNIX host for static HTML, where did you see this?


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  4. mjp

    mjp

  5. haha ok I will.

    I still give recommendations to my friends to host their static sites here. Simply for the uptime, control panel, and email features we offer. Though I would like to see more bandwidth offered :)


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  6. Thanks Joel and Edified
    You are right Joel, that's exactly what I was looking for, it works.

    Cosmoworlds - www.cosmoworlds.com
     
  7. Do you have the code for redirect domainto subdirectory?
     
  8. You could have something like the following in your default page :

    if (Request.Url.ToString().Contains('domain.com'))
    {
    Response.Redirect('/sub-directory');

    }

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 1/9/2007 8:56:00 PM GMT
     

Share This Page