diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 529dbca..15444b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,7 @@ ## Styling - Put your snippets into corresponding sections. +- Put the snippet names into the [Table of Contents](README.md#table-of-contents) and link them using relative URLs. - Use `###` headers for your snippets. - Add some note/description if applicable. People will thank you for that. - Be grateful. Indicate a source using this format `[Source](link)` if applicable. diff --git a/README.md b/README.md index 9dc9057..05ad2a3 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,31 @@ A collection of useful .htaccess, all in one place. I decided to create this rep ## Table of Contents - [Rewrite and Redirection](#rewrite-and-redirection) + - [Force www](#force-www) + - [Force www in a Generic Way](#force-www-in-a-generic-way) + - [Force non-www](#force-non-www) + - [Force HTTPS](#force-https) + - [Force Trailing Slash](#force-trailing-slash) + - [Redirect a Single Page](#redirect-a-single-page) + - [Redirect an Entire Site](#redirect-an-entire-site) - [Security](#security) + - [Deny All Access](#deny-all-access) + - [Deny All Access Except Yours](#deny-all-access-except-yours) + - [Allow All Access Except Spammers'](#allow-all-access-except-spammers) + - [Deny Access to Hidden Files and Directories](#deny-access-to-hidden-files-and-directores) + - [Disable Directory Browsing](#disable-directory-browsing) + - [Disable Image Hotlinking](#disable-image-hotlinking) + - [Password Protect a Directory](#password-protect-a-directory) + - [Password Protect a File or Several Files](#password-protect-a-file-or-several-files) - [Performance](#performance) + - [Compress Text Files](#compress-text-files) + - [Set Expires Headers](#set-expires-headers) + - [Turn eTags Off](#turn-etags-off) - [Miscellaneous](#miscellaneous) + - [Set PHP Variables](#set-php-variables) + - [Custom Error Pages](#custom-error-pages) + - [Force Downloading](#force-downloading) + - [Allow Cross-Domain Fonts](#allow-cross-domain-fonts) ## Rewrite and Redirection Note: It is assumed that you have `mod_rewrite` installed and enabled. @@ -123,6 +145,21 @@ AuthUserFile /home/fellowship/.htpasswd Require valid-user ``` +### Password Protect a File or Several Files +``` apacheconf +AuthName "One still does not simply" +AuthType Basic +AuthUserFile /home/fellowship/.htpasswd + + +Require valid-user + + + +Require valid-user + +``` + ## Performance ### Compress Text Files ``` apacheconf