WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess file (4 posts)

  1. obidos
    Member
    Posted 2 years ago #

    Hello all,

    I have an issue with permalinks and a custom 404 page.

    If I turn off permalinks then my custom 404 page works. If I use permalinks my custom 404 page is not shown just a the footer code for my theme. No header or content in anyway just the code itself written on the screen.

    Here is the contents of the .htaccess file:-

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

    Why does it not work :(

  2. Pothi
    Member
    Posted 2 years ago #

    It doesn't work with permalinks, because 404 page is handled by the WordPress and/or the theme itself. Please check out Creating_an_Error_404_Page for creating a custom 404 page.

  3. obidos
    Member
    Posted 1 year ago #

    Hello,

    I have created a 404 page within my theme and still getting some off results.

    If I turn permalinks off and then on again it will show only the footer code.

    I keep testing it and then I just get The connection was reset! My site works so it's not a server error.

    Any ideas? Is my host causing these issues?

    I have created a wordpress 404 page for a custom theme on another server and that works. So I know I'm doing it correctly.

  4. s_ha_dum
    Member
    Posted 1 year ago #

    I have created a 404 page within my theme and still getting some off results.

    Did you also remove that ErrorDocument line?

    Any ideas? Is my host causing these issues?

    Maybe. Do your other pretty permalinks work? It is possible to prevent rewriting error documents, but the same switch disables other rewriting as well.

    http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags