WordPress.org

Ready to get started?Download WordPress

Forums

Everything redirects to the main directory !?!? (2 posts)

  1. danielrm26
    Member
    Posted 8 years ago #

    Greetings,

    How can I keep everything that's mis-typed from going to my site's default page? Here's my .htaccess:


    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Essentially, I want to be able to make myself a 404 page and have it work, as well as keep from having every single url come up as valid on the site. It doesn't even redirect when you go to /whateveryouwant -- it just renders the /index.php while keeping /whateveryouwant in the URL bar.

    What am I missing?

    Thanks in advance,

    -Daniel (dmiessler.com/thispagedoesntexist)

  2. Xenomorph
    Member
    Posted 8 years ago #

    they changed some weird stuff in WordPress 2.x

    i couldnt figure out WHY they made the change to the 404 system.

    check out my other thread:

    http://wordpress.org/support/topic/68979?replies=3

    basically, since everything is sent to your /index.php, you need to set your index.php up to handle 404s using WordPress.

    i added this to the top of my index.php:

    if (is_404())
    {
    require("/path/to/404.php");
    exit;
    }

    you may need to change some other of your pages' code to get 404s working just right.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags