WordPress.org

Ready to get started?Download WordPress

Forums

ErrorDocument (3 posts)

  1. blueorder
    Member
    Posted 8 years ago #

    Little help...

    I've been trying to set a custom 404 error with ErrorDocument in my .htaccess. Every time I try to enter an incorrect address to a file or folder, the page reloads with my theme and just the post text.

    Here's how my .htaccess file looks:

    ErrorDocument 404 /404.php

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^test.theamells.net [NC]
    RewriteRule ^(.*)$ http://test.theamells.net%{REQUEST_URI} [R=301,L]

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

    # END WordPress

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    Can you not just specify those error docs through your cpanel ?

    Where is 404.php ?
    Try putting that code after the WordPress block ?

  3. schestowitz
    Member
    Posted 8 years ago #

    Have 404.shtml in your home directory to achieve custom error pages in Apache. You might need to point to such files though rather than do it the laborious way as you are attempting to do.

Topic Closed

This topic has been closed to new replies.

About this Topic