开发者

How to protect directories

开发者 https://www.devze.com 2023-04-09 04:37 出处:网络
I have uploaded different Microsoft Word documents to the directory ht开发者_如何学Ctp://www.mywebsite.com/documents/

I have uploaded different Microsoft Word documents to the directory ht开发者_如何学Ctp://www.mywebsite.com/documents/

Now the problem is that when I browse to this url you can see all my documents in a list but they need to be hidden and only aproachable by a given link (for example http://www.mywebsite.com/documents/document1.doc)

Any idea how I can do this? Is it OK to place a index.html in every documents directory so they get a blank page, or does Google not like this?


If you are using IIS, make sure you have unchecked the "Allow Directory Browsing" in the directory properties.

If you are using Apache, read this

Apache configuration


you can disable directory browsing using .htaccess file if you use apche.

just add the below line into your .htaccess file

Options -Indexes

This will disable the directory browsing in your website.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号