Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

totoro3 on "How to make a file look like it does not exist (404 redirect)"

$
0
0

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.


Viewing all articles
Browse latest Browse all 8245

Trending Articles