Reputation: 31
I'm building a website, but I'm not entirely sure what to do with the .htaccess file. Say for example I have a folder called pages which holds all my pages, can i deny access to someone if they type in www.website.com/pages so that they can't see the directory? I've tried putting the .htaccess file in the pages folder with the "deny from all" line and although it denies access, it's also denying access to the actual pages. Is there a way to do this without denying access to see the pages on the website, just denying access to the directory?
Sorry if this doesn't make much sense, I'm so confused lol. Thanks for any help.
Upvotes: 3
Views: 4899
Reputation: 1
You can log into your site manager and then you can use you index manager to say which folder you would like to protect. I just did mine
Upvotes: 0
Reputation: 888
Most hosts I've used do it with the IndexIgnore *
directive.
just put that in a .htaccess file and drop it into the folder you want to block indexing of.
More info: Apache IndexIgnore Documentation.
Upvotes: 1
Reputation: 401032
If you don't want Apache to display the list of files in the directory, you can use
Options -Indexes
To disable the indexes
feature.
See the Options Directive section of Apache's manual, for more informations.
Else, an "easy way" would be to just put an empty index.html
or index.php
file -- i.e. a default file that Apache uses when one is trying to access a directory.
About that, see the DirectoryIndex Directive.
Upvotes: 6