Support » Fixing WordPress » .htaccess troubles

  • Why doesn’t a standard 404 redirect work in 2.0.x ?

    .htaccess= ErrorDocument 404 /index.php

    I just get a message on a template page: Sorry, no posts matched your criteria.

    I don’t want that. I want 404 pages to rediret to the root.

    What seems to be wrong?

    Thank you,

    Babalao

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try changing that line in your .htaccess to:

    ErrorDocument 404 /index.php?error=404

    Then add a 404.php template to your theme. Easiest way to do that is to copy index.php (to 404.php), then edit (or edit out) The Loop to display whatever you think is appropriate.

    (Note the .htaccess stuff may not be necessary in 2.0.x, but covering all the bases here.)

    Ok,

    That sounds easy enough.

    Then I can just code 404.php to redirect to root.

    Thank you.

    Hey, that worked perfectly. here’s the contents to 404.php BTW:

    <?php
    $url[0]=’/’;
    $url[1]=’/’;
    srand((double)microtime()*1234567);
    $turl=$url[intval(rand(0,1))];
    header(“location: $turl”);
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘.htaccess troubles’ is closed to new replies.