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
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How to prevent 404 for an empty directory?

    Code:
    Options –Indexes
    I though the above would work but it brought the site down...

    I have paths like folder/folder/index.php but there is nothing in the initial folder.

    Any ideas what I can do?

    I can always place an index.html in the folder I guess but I dont really see that as a fix....

    Thanks!

  • #2
    New Coder
    Join Date
    Apr 2013
    Posts
    21
    Thanks
    0
    Thanked 1 Time in 1 Post
    Can you at least post your configuration here? It would be more helpful for us to give an idea.

  • #3
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by andy_urllab View Post
    Can you at least post your configuration here? It would be more helpful for us to give an idea.
    thanks - not sure how much I can help with explaining my configuration. My .htaccess only really has 301 redirects and that's it.

    My site structure is such that I have folders that have no index file, but contain another folder that does have an index file. For example, lets say that I sell fruit, my structure is like this:

    mysite.com/fruit/apples/

    The 'fruit' folder is the parent for all the types of fruits we sell and hence why there is no index in there. I can add an index of course but id just rather than an htaccess rule that prevents the error 404, because if the user deletes the /apples/ bit of the path then they get the error. Does that makes sense?

    Let me ask you another way, is it better practice to have an index in each folder? Thanks


  •  

    Posting Permissions

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