-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

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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.