Actually.... you can with .htaccess protect a file, group of files or a directory, limit methods like POST/GET. (sorry chirpy)
Create a standard .htaccess
Code:
AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName JustMe
AuthType Basic
Now add the following at the end
Code:
<Files admin.cgi>
Require user admin
</Files>
You should now have
Code:
AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName JustMe
AuthType Basic
<Files admin.cgi>
Require user admin
</Files>
NOTE: This traverses subdirectories as well.
To do pattern protect replace the file part with
Code:
<Files ~ "\.(gif|jpe?g|png)$">
Require user admin
</Files>