Cannot Override Wordpress 404 for a Sub-Directory
I have wordpress installed on my root (/var/www/html
) and I have a sub-directory in the root as /var/www/html/manage
Both directories have it's own .htaccess
files. Content of the .htaccess
are as follows.
/var/www/html/.htaccess (root)
# 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
/var/www/html/manage/.htaccess (Sub-directory)
# Start Manage .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
ErrorDocument 404 /lost.php
# End Manage .htaccess
I can rewrite .php
extension of the the php
files in the sub-directory with the .htaccess but I cannot use custom 404 as defined in the htaccess file in the sub-directory. When I go to www.example.com/manage/laksjdflskjf
it shows wordpress 404 instead of lost.php
How Can I make the sub-directory to show its 404 instead of wordpress 404?