I am trying to figure out how to make a file appear like a file not found. If for example someone goes to site.com/post-that-does-not-exist/ they will be sent to the 404 page (at the same URL) with a 404 header.
I want this to happen if someone goes to files in my plugin eg site.com/wp-includes/plugins/my-plugin/my-plugin.php
I saw on this page that code like this will hide your file content if it is accessed directly:
defined('ABSPATH') or die("No script kiddies please!");
So how can I change this to display the 404 page?
Thanks in advance for any advice.