how to deny public access to website root folder?

Hello

I want to do something and I really don’t have a clue how to do it. I want to prevent people to be able to access/see/explore my root folders in my web site; for example: www.mydomain.com/folder/. If they do this they can see my root folder and I only want them to see only the page I direct them to it in this folder like for example: www.mydomain.com/folder/hoeto.html . I want if they type www.mydomain.com/folder/ it will not direct them to my root folder it will give them an error message.

Thanks

note: I am using yahoo as webhost.And Frontpage2003

3 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    The easiest thing to do is always have a document in your folders named index.htm, which is the default document name.

    You can also use PHP to prevent directory browsing. Make a text file named index.php. It will contain ONLY this code:

    <?

    header('Location: /');

    ?>

    No HTML, no nothing -- ONLY the three lines above!

    Put that anyplace where you have a directory without an index.htm or index.php file, and it will kick people back to your home page if they try to directory browse.

  • Anonymous
    1 decade ago

    This can be probably easily achieved by putting a default document into each folder- what the filename of this document should be varies between setups but it is most often index.html. Then, when someone opens the directory url, he will get the index.html page instead of a directory listing.

  • puorto
    Lv 4
    4 years ago

    Yeah, do not attempt to place the document on your root itemizing. that may not going to paintings, when you consider that your internet server application is in all probability set to in uncomplicated terms get entry to information in a limited area. it is why your symlink isn't working the two. What software are you utilising to set that distinctive techniques up? What webserver? have you ever tried putting the contents of that document right into a region your internet server is set to get entry to? Even a separate script might paintings.

Still have questions? Get your answers by asking now.