htaccess - 可以阻止目录视图,但文件仍然可以直接查看[重复]

Possible Duplicate:
Hotlinking my Cascading Style Sheets

This is a bit of a follow up to this question .htaccess don't allow user to view my folder files that don't have index.php which worked perfectly for blocking directory level access, but it still doesn't block direct access if someone knew the url

i.e. domain.com/css/ is forbidden, but domain.com/css/main.css shows the css file

how would i block direct access to that file? it seems like such a standard thing but i can't find anything for it

You can set restrictions like this:

Order Deny, Allow
Deny from all #everyone will not be allowed except the following line
Allow from 127.0.0.1 123.123.123.123 #allowed hosts separated by space

In the .htaccess for the directory, you can write:

Deny from All

This way nobody will be able to access anything in the directory remotely.