Jump to content

[SOLVED] Blocking directory..


phpSensei

Recommended Posts

You could just put a PHP file 'index.php' with the following code:

<?php
// Redirect them to your site's main page
header("Location: http://www.mydomain.com/");
?>

Of course, if someone knows the name of a file in the directory, they can just type it in, but if the script performs a sensitive task (uploading files, displaying sensitive info, etc.), you should probably be using sessions or something to stop unauthorized access anyway...

 

For example when I do the admin part of a website, either I just password the directory with all the admin scripts, or I do a login script w/ sessions to prevent BAD stuff...

This same thing can and should be done by turning off directory listings in Apache. But if it's just data files that you need grant privileges to system but not users and if you can store it out of the html directory all together so that its contents cannot be served up to a malicious user.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.