Forums

Error 404 Problem With Redirects (1 post)

  1. caneblock
    Member
    Posted 3 years ago #

    I've noticed on my WordPress blog that if I go to a url that does not exist (eg http://www.domain.com/a), WordPress will find an article that starts with the letter a and return it.

    If however, I go to a url that doesn't exist and contains lots of gibberish characters (eg http://www.domain.com/adadf) and wordpress cannot find an article that starts with adadf, it returns a 404.

    How do I get wordpress to return a 404 for all pages that don't exist, rather then just the ones that it can't find a suitable article for.

    I am using permalinks (/%postname%/) and my htaccess looks as follows:

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

    # END WordPress

    Options All -Indexes

    # to protect wp-config.php
    <Files wp-config.php>
    order allow,deny
    deny from all
    </Files>

    # to protect the .htaccess file itself:
    <Files .htaccess>
    order deny,allow
    deny from all
    </Files>

Topic Closed

This topic has been closed to new replies.

About this Topic