WordPress.org

Support

Support » Themes and Templates » .htaccess file

.htaccess file

  • 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 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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.

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘.htaccess file’ is closed to new replies.
Skip to toolbar