我无法隐藏访客的php核心文件

Right now im using .htaccess to hide certain folders from being viewed by visitors using

"Options -Indexes"

If I user types www.mysite.com/foldername/ a error page gets displayed which I want, but how can I make sure users cant see the files themself in those folders?

Eg: www.mysite.com/ajax/file.php show if the user types that in, but www.mysite.com/ajax/ will show a error page.

How can I make sure users cant view single files in folders? I have a few files in my ajax folder and also my /functions/ folder that I dont want users being able to see

Thanks in advance

Usually files you dont want people to see would be keep out of your public folder.

like this:

-root
--public_html
---index.php
--application (secret)
---somefile.php

You would then include them in index.php like this:

require('../application/somefile.php');

But the content of your php isnt visible to visitors and if used with ajax, they have to be accessible via the browser.

If you dont want people to get a list of files in a folder, you can put in an index.php to prevent it.