The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] How to modify .htaccess for custom 404 on subdomain? newbie questions. (4 posts)

  1. Ciryaquen
    Posted 11 years ago #

    These are a total newbie questions. I will appreciate advice. (I did look at the codex and Apache.org sites for info first.)

    1. How should the command to use a custom 404 error page be written into the .htaccess when WordPress is installed in a subdomain?

    On my site a mistyped url returns a plain text Apache 404 error instead of the custom 404 page in the Kubric theme. WordPress is installed in a subdomain (e.g. www.wordpress.domain.com) and not a directory (e.g. www.domain.com/wordpress/). In FTP, the subdomain is a folder on the site /domain/wordpress.

    Do I use the format from the codex for a directory?

    ErrorDocument 404 /wordpress/index.php?error=404

    or is there some other way for a subdomain?

    2. Where in the .htaccess file do I insert the code? i.e. Should the 404 page code go before or after the WordPress permalinks, or does it matter?

    There was no .htaccess file until WordPress generated one when permalinks was activated. (It's located in the subdomain's folder. There's no .htaccess in the site's root directory.) There's a blank line at the top. Then a bunch of code in between

    # BEGIN WordPress
    [ permalinks commands edited out for this post]
    # END WordPress

    I will appreciate advice.

  2. James Huff
    Support Team Rep.
    Posted 11 years ago #

    Insert this line into the top of the .htaccess file in your subdomain's folder before the # BEGIN WordPress part:

    ErrorDocument 404 /index.php?error=404

  3. Ciryaquen
    Posted 11 years ago #

    Thank you macmanx!

    That worked perfectly.

  4. getarun_vr
    Posted 10 years ago #

    Also check out http://www.arunrocks.com/blog/archives/2006/03/01/a-nearly-perfect-404-error-page-in-wordpress/

    for a end to end tutorial on creating 404 pages

Topic Closed

This topic has been closed to new replies.

About this Topic