-1

I'm using $_GET method like this

if($_GET['page']=="first") {include('pages/first.php');}

But how do 404 when user reach example.com/pages/first.php ? Thanks

user2444990
  • 1
  • 1
  • 2
  • 6
    You could keep them outside of the web directory - you can include them, but they wouldn't be accessible to browsers. – andrewsi Jun 06 '13 at 14:02

1 Answers1

1

You can add a .htaccess file to your 'pages' folder with the following contents:

Deny from all

Please take note that this will prevent access to all files in this directory, so you should put your public files in a different directory.

opznhaarlems
  • 337
  • 2
  • 9