Htaccess,重写并显示404

Sorry if this is a duplicate, may be I'm using the wrong keywords, but I was unable to find a solution.

My question is how (using Apache; .htaccess) to achieve the following:

I have a file called show_results.php, and I want to: Rewrite show_results.php to /results and when someone tries to access show_results.php to bring a 404 error (but /results must work correctly).

I've tried many different ways, but with no luck - when I rewrite, I'm able to access to original page. When I try to redirect the original page to 404 page, the "rewrited" page is showing 404 as well.

Thank you!

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On
RewriteBase /

# To return 404 for any/dir/foo.php
RewriteCond %{THE_REQUEST} /.+?\.php[\s?] [NC]
RewriteRule ^ -[R=404,L]

## To internally redirect /dir/file to /dir/file.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]