custom 404 that returns 404 instead of 200

Discussion in 'Install/Configuration' started by jrmarino, Jun 16, 2007.

  1. jrmarino

    jrmarino New Member

    I just realized that my Google webmaster tools no longer works. This is because I enabled the custom 404 pages. Here is the explanation google provided:

    Can I do this in Litespeed? I want to return a 404 status for the custom 404 pages that catch bad URLs so I can recover my Google webmaster tools functionality.
  2. mistwang

    mistwang LiteSpeed Staff

    Are you using a script for the custom 404 page? Internally, LiteSpeed does return 404 for static custom error page.

    Our Rails support uses 404 handler, the status code returned by the script will be used. So, if you use a script for 404 page, you should explicitly set the status code to 404 in the script.
  3. jrmarino

    jrmarino New Member

    I'm not sure I understand the question.

    Under virtual host --> general I defined a custom error page for the error "404 not found". After that, All I did was set the URL, which happens to be $VH_root/404.php

    do you consider the "404.php" file a script? Seems like it could be static HTML will the same result.
  4. mistwang

    mistwang LiteSpeed Staff

    404.php is a PHP script. Using static HTML will return 404.
    If you want to use 404.php, you need to set status code to 404 explicitly in that script.
  5. jrmarino

    jrmarino New Member

    Thanks, I figured it out. Google is happy now.

Share This Page