My theme include a 404.php template file. but when I search something that doesn't exist using default WordPress search engine, I encounter index.php with no post. What should I do if I want to redirect URL to 404.php template?
I'm running WordPress on a local host. Don't have a search.php template and I have added code below to .htaccess
ErrorDocument 404 /wordpress/index.php?error=404