Skip to content

Instantly share code, notes, and snippets.

@Narayon
Forked from simaovergalho/index.php
Last active April 8, 2018 01:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Narayon/90a9423aa04771dbcd24 to your computer and use it in GitHub Desktop.
Save Narayon/90a9423aa04771dbcd24 to your computer and use it in GitHub Desktop.
PHP: prevent direct folder/file access
if( ! defined('ABSPATH') ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
//OR
if ( ! defined('ABSPATH') ) { die('-1'); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment