Exclude Page from 404 Redirect

A page or directory can be excluded from the WordPress redirect with an amendment of the .htaccess file.

By default pages WordPress owns the directories and files of a website instance. If a page or directory is not known to it then a redirect is given to a 404 page.

The page and directory redirect in WordPress is governed by the Apache RewriteEngine, typically by entries in the .htaccess file in the root of the website.

Edit the .htaccess file, either by using the file editor in the website hosting administration control panel, of by downloading the file editing and then putting it back again.

In the example below the line in blue is added. It defines a re-write condition for the directory /cny2012_13/.

DirectoryIndex index.cgi index.php

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

Having amended the file re-upload it to the root of the website.