I hope I can explain this…
I’m using this code in my .htaccess file to hide .php extensions thereby making (for instance) cat.php just cat/ which I believe is called a virtual directory?
[php]RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.[^/])/?$ $1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.)$ /$1/ [R=301,L][/php]
That all works great. The problem is that if I try the error page as something like http://domainname.com/cat/somethingrandom/ it goes to the server 404 page instead of my custom 404 page. My custom 404 works everywhere else, including real directories. Help please?