www.webdeveloper.com
Results 1 to 7 of 7

Thread: General Web Site Question

  1. #1
    Join Date
    Aug 2010
    Posts
    41

    General Web Site Question

    Alright so right now a person can type my url and a folder name and access the directory. This is NOT GOOD. How do i set it so it redirects to a 404?

  2. #2
    Join Date
    Oct 2007
    Location
    Western Massachusetts, USA
    Posts
    387
    You could always make a fake index.html/php whatever and throw it into the directories you want blocked off, it is a cheap and flawed method, but it turns back most people. Another method is to password protect directories or set up redirection. It depends on your web server, be it the Apache web server, a Microsoft one, or some other httpd.
    Computer programmer / web developer.

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,175
    If it is running on Apache, you can either change the Apache settings or use a .htaccess file in the web root directory to disallow directory listings:
    Code:
    Options -Indexes
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Aug 2010
    Posts
    41
    Thanks guys!

    Is that all I have to do with the htaccess file?

  5. #5
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,175
    That's all you need in it for this issue.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  6. #6
    Join Date
    Mar 2010
    Posts
    672
    If they are just include files you can also throw in a "deny from all" into the htaccess to make the files inaccessible even if someone knows the filename (or could guess it).

  7. #7
    Join Date
    Oct 2007
    Location
    Western Massachusetts, USA
    Posts
    387
    Quote Originally Posted by Jarrod1937 View Post
    If they are just include files you can also throw in a "deny from all" into the htaccess to make the files inaccessible even if someone knows the filename (or could guess it).
    Good idea, I forgot about good old ACLs, which is odd, considering I just spent two years in a school learning about them every other week in a networking course.
    Computer programmer / web developer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles