Support » Fixing WordPress » Skip WordPress for Standard Errors

  • I’ve created 400, 401, 403, 404 and 500 error pages for my site and they are specified in the beginning of .htaccess. For example,

    ErrorDocument 400 /errors/400.htm
    ErrorDocument 401 /errors/401.htm
    ErrorDocument 403 /errors/403.htm
    ErrorDocument 404 /errors/404.htm
    ErrorDocument 500 /errors/500.htm

    But, 404 isn’t used. When accessing an non existent page, WordPress still revert back to index.php, not the one I’ve defined.

    Any advice?

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter droimbai

    (@droimbai)

    I’ve thrown together the following hack from various sources on the web. It seems to work, but I’d like to run across the experts here to see if there will be any potential problems:

    RewriteEngine on
    RewriteCond $1 ^(index\.php)?$ [OR]
    RewriteCond $1 \.(jpg|png|gif|css|js|ico|mp3)$ [NC,OR]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ - [S=1]
    RewriteRule . /index.php [L]

    What do you think? The whole aim here is to minimize running WordPress for standard errors.

    Thanks for your time.

    Edit: Alas, nope this doesn’t work. Break WordPress. 🙁

    Is there a 404.php within your theme’s files?

    Thread Starter droimbai

    (@droimbai)

    Yup there is. But, I’m trying to bypass it (WordPress) if possible to reduce load on my server.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Skip WordPress for Standard Errors’ is closed to new replies.