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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.