WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Forwarding 404 Error (5 posts)

  1. MTWK-Applied
    Member
    Posted 1 year ago #

    I'm trying to forward wordpress errors to a non-wordpress page using htaccess.

    I have this .htaccess in the theme directory.

    php_value memory_limit 150M

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /new/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /new/index.php [L]
    </IfModule>
    <Files "wp-cron.php">
    Allow from All
    Satisfy Any
    </Files>
    <Files "/var/www/vhosts/domain.com/httpdocs/new/wp-cron.php">
    Allow from All
    Satisfy Any
    </Files>
    # END WordPress

    ErrorDocument 404 http://domain.com/errorPage.html

    The error forwarding is being ignored and is going to "No Results Found. Is there a workaround? Do I need to us the no-results.php for the theme? Does the no-results.php handle all errors?

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Why not just create a 404.php template page in your theme? Also, the WordPress permalink rewrite rules should always be at the end of the .htaccess file.

  3. MTWK-Applied
    Member
    Posted 1 year ago #

    You mean create a new template for this page.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Yes - see creating a 404 error page. Alternatively, re-organise your .htaccess file to that the WordPress rewrite rules are at the bottom and your error404 directive is at the top.

  5. MTWK-Applied
    Member
    Posted 1 year ago #

    This is set. Thx.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.