Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    34
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Alternate to Blank index file

    Hi I just want to know if there is a .htaccess alternate, instead of placing a blank index.php file in every directory so the contents are not shown.

    - possibly to hide the contents of the directory or just a redirect to a page not found global page. I know that's what you do for non existing directories using:

    Code:
    ErrorDocument 400 /error/400.htm
    ErrorDocument 401 /error/401.htm
    ErrorDocument 403 /error/403.htm
    ErrorDocument 404 /error/404.htm
    ErrorDocument 500 /error/500.htm
    But like I said, I want to make it so that it will redirect even if there is a directory, as long as there is not index file to display to the visitor.

    I am new to using .htaccess, so any help is greatly appreciated.

    Thank you!
    Last edited by lankanmon; 07-25-2011 at 03:14 PM.

  • #2
    New Coder
    Join Date
    Feb 2011
    Posts
    34
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Anyone have any suggestions?

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    In your .htaccess file:
    Code:
    Options -Indexes


  •  

    Posting Permissions

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