HTACCESS DOC ---------- http://corz.org/server/tricks/htaccess.php http://www.javascriptkit.com/howto/htaccess11.shtml ======= AuthName "Pictures" #basially, the prompt users will see AuthType Basic AuthUserFile /home/steve/public_html/spics/.htpasswd AuthGroupFile /dev/null Require valid-user ======= SERVER SIDE INCLUDE FILES (but php is this; is this needed now?) XBitHack on # server will then look at all executable files in cwd for directives #Equivlent to making the relevant files .shtml #perl-like If exec by server, will include file ".msgfile" Alternative to php ======= ORDER cmd: #One main point of these 'Order's is that the order in .htaccess of the #'Order' line, the allow lines, and the deny lines doesn't matter. Order allow,deny 1) apply all allow rules 2) apply all deny rules; 3) deny everything else. Order deny,allow 1) apply all deny rules 2) apply all allow rules; 3) allow everything else. ======= INDIVIDUAL FILE BARRING. Needn't be after AUTH etc. in .htaccess? # that bars access to all files beginning 'un' # that bars access to one file with full name order allow,deny #deny from all #Means deny TO all users. Actually redundant, given 'order' line. ====== Customised error docs Can be good for offering user near-matches; redirects; auto-correct (search for near-match and auto-jump if only one of them). ErrorDocument 403 /~steve/courses/archive/test/yy ErrorDocument 403 "My Infile Error 403" #could put HTML in the ".." ====== IndexOptions FancyIndexing IconHeight=16 IconWidth=16 This is not needed on our server; but illustrates how to turn server options on ====== Require valid-user Require all denied [all users denied] Require user steve [only 'steve' allowed] Filter classes of allowed users ====== DIR INDEXs Options -Indexes # should turns off all server-found indexes But the cmd "Options" is NOT allowed locally by our server DirectoryIndex dirs.php #Uses that one index file first [then defaults to rest] IndexIgnore un* #Block files from showing in the auto-index file if it is used in current directory This stops the auto-index from listing files un* Even with just * you get an index page (but nothing listed) ====== FILE REDIRECTION [must be all on one line.] Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html ====== Other stuff can be done. MIME responses by browser to various suffixed files. Block hot linking (of imgs)