W3-Video WEB Tutorials

w3-video.com is a Free eLearning Website with over 500 video tutorials on HTML5, XAMPP, .htaccess, Firefox, Notepad++

.htaccess Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

3. Allowed directives in .htaccess, Tutorial

Share it

Directives .htaccess

Below the List of all Directives allowed in .htaccess
Although allowed, these directives can't be added within the .htaccess file unless the AllowOverride directive specifies the grouping of directives they belong to or has the value 'All'.

Complete Directives List .htaccess

AcceptPathInfo On|Off|Default
Action action-type cgi-script [virtual]
AddAlt string file [file] ...
AddAltByEncoding string MIME-encoding [MIME-encoding] ...
AddAltByType string MIME-type [MIME-type] ...
AddCharset charset extension [extension] ...
AddDefaultCharset On|Off|charset
AddDescription string file [file] ...
AddEncoding MIME-enc extension [extension] ...
AddHandler handler-name extension [extension] ...
AddIcon icon name [name] ...
AddIconByEncoding icon MIME-encoding [MIME-encoding] ...
AddIconByType icon MIME-type [MIME-type] ...
AddInputFilter filter[;filter...] extension [extension] ...
AddLanguage MIME-lang extension [extension] ...
AddOutputFilter filter[;filter...] extension [extension] ...
AddOutputFilterByType filter[;filter...] MIME-type [MIME-type] ...
AddType MIME-type extension [extension] ...
Allow from all|host|env=[!]env-variable [host|env=[!]env-variable] ...
Anonymous user [user] ...
Anonymous_LogEmail On|Off
Anonymous_MustGiveEmail On|Off
Anonymous_NoUserID On|Off
Anonymous_VerifyEmail On|Off
AuthBasicAuthoritative On|Off
AuthBasicProvider provider-name [provider-name] ...
AuthDBMGroupFile file-path
AuthDBMUserFile file-path
AuthDefaultAuthoritative On|Off
AuthDigestAlgorithm MD5|MD5-sess
AuthDigestDomain URI [URI] ...
AuthDigestNonceFormat format
AuthDigestNonceLifetime seconds
AuthDigestProvider provider-name [provider-name] ...
AuthDigestQop none|auth|auth-int [auth|auth-int]
AuthGroupFile file-path
AuthLDAPBindAuthoritative off|on
AuthLDAPBindDN distinguished-name
AuthLDAPBindPassword password
AuthLDAPCompareDNOnServer on|off
AuthLDAPDereferenceAliases never|searching|finding|always
AuthLDAPGroupAttribute attribute
AuthLDAPGroupAttributeIsDN on|off
AuthLDAPRemoteUserAttribute uid
AuthLDAPRemoteUserIsDN on|off
AuthName auth-domain
AuthType Basic|Digest
AuthUserFile file-path
AuthzDBMAuthoritative On|Off
AuthzDBMType default|SDBM|GDBM|NDBM|DB
AuthzDefaultAuthoritative On|Off
AuthzGroupFileAuthoritative On|Off
AuthzLDAPAuthoritative on|off
AuthzOwnerAuthoritative On|Off
AuthzUserAuthoritative On|Off
BrowserMatch regex [!]env-variable[=value] [[!]env-variable[=value]] ...
BrowserMatchNoCase regex [!]env-variable[=value] [[!]env-variable[=value]] ...
CGIDScriptTimeout time[s|ms]
CGIMapExtension cgi-path .extension
CharsetDefault charset
CharsetOptions option [option] ...
CharsetSourceEnc charset
CheckCaseOnly on|off
CheckSpelling on|off
ContentDigest On|Off
CookieDomain domain
CookieExpires expiry-period
CookieName token
CookieStyle Netscape|Cookie|Cookie2|RFC2109|RFC2965
CookieTracking on|off
DefaultIcon url-path
DefaultLanguage MIME-lang
DefaultType MIME-type|none
DeflateInflateLimitRequestBody value
DeflateInflateRatioBurst value
DeflateInflateRatioLimit value
Deny from all|host|env=[!]env-variable [host|env=[!]env-variable] ...
DirectoryIndex local-url [local-url] ...
DirectorySlash On|Off
EnableMMAP On|Off
EnableSendfile On|Off
ErrorDocument error-code document
ExpiresActive On|Off
ExpiresByType MIME-type <code>seconds
ExpiresDefault <code>seconds
FallbackResource disabled | local-url
FileETag component ...
<Files filename> ... </Files>
<FilesMatch regex> ... </FilesMatch>
FilterChain [+=-@!]filter-name ...
FilterDeclare filter-name [type]
FilterProtocol filter-name [provider-name] proto-flags
FilterProvider filter-name provider-name [req|resp|env]=dispatch match
ForceLanguagePriority None|Prefer|Fallback [Prefer|Fallback]
ForceType MIME-type|None
Header [condition] set|append|merge|add|unset|echo|edit header [value] [replacement] [early|env=[!]variable]
HeaderName filename
<IfDefine [!]parameter-name> ... </IfDefine>
<IfModule [!]module-file|module-identifier> ... </IfModule>
<IfVersion [[!]operator] version> ... </IfVersion>
ImapBase map|referer|URL
ImapDefault error|nocontent|map|referer|URL
ImapMenu none|formatted|semiformatted|unformatted
IndexHeadInsert "markup ..."
IndexIgnore file [file] ...
IndexOptions [+|-]option [[+|-]option] ...
IndexOrderDefault Ascending|Descending Name|Date|Size|Description
IndexStyleSheet url-path
ISAPIAppendLogToErrors on|off
ISAPIAppendLogToQuery on|off
ISAPIFakeAsync on|off
ISAPILogNotSupported on|off
ISAPIReadAheadBuffer size
LanguagePriority MIME-lang [MIME-lang] ...
LDAPTrustedClientCert type directory-path/filename/nickname [password]
<Limit method [method] ... > ... </Limit>
<LimitExcept method [method] ... > ... </LimitExcept>
LimitRequestBody bytes
LimitXMLRequestBody bytes
MetaDir directory
MetaFiles on|off
MetaSuffix suffix
MultiviewsMatch Any|NegotiatedOnly|Filters|Handlers [Handlers|Filters]
Options [+|-]option [[+|-]option] ...
Order ordering
PassEnv env-variable [env-variable] ...
ReadmeName filename
Redirect [status] URL-path URL
RedirectMatch [status] regex URL
RedirectPermanent URL-path URL
RedirectTemp URL-path URL
RemoveCharset extension [extension] ...
RemoveEncoding extension [extension] ...
RemoveHandler extension [extension] ...
RemoveInputFilter extension [extension] ...
RemoveLanguage extension [extension] ...
RemoveOutputFilter extension [extension] ...
RemoveType extension [extension] ...
RequestHeader set|append|merge|add|unset|edit header [value] [replacement] [early|env=[!]variable]
Require entity-name [entity-name] ...
RewriteBase URL-path
RewriteCond TestString CondPattern
RewriteEngine on|off
RewriteOptions Options
RewriteRule Pattern Substitution [flags]
RLimitCPU seconds|max [seconds|max]
RLimitMEM bytes|max [bytes|max]
RLimitNPROC number|max [number|max]
Satisfy Any|All
ScriptInterpreterSource Registry|Registry-Strict|Script
ServerSignature On|Off|EMail
SetEnv env-variable [value]
SetEnvIf attribute regex [!]env-variable[=value] [[!]env-variable[=value]] ...
SetEnvIfNoCase attribute regex [!]env-variable[=value] [[!]env-variable[=value]] ...
SetHandler handler-name|None
SetInputFilter filter[;filter...]
SetOutputFilter filter[;filter...]
SSIEnableAccess on|off
SSIErrorMsg message
SSIETag on|off
SSILastModified on|off
SSITimeFormat formatstring
SSIUndefinedEcho string
SSLCipherSuite cipher-spec
SSLOptions [+|-]option ...
SSLProxyCipherSuite cipher-spec
SSLRenegBufferSize bytes
SSLRequire expression
SSLUserName varname
SSLVerifyClient level
SSLVerifyDepth number
Substitute s/pattern/substitution/[infq]
UnsetEnv env-variable [env-variable] ...
XBitHack on|off|full

Video demonstration Allowed directives in .htaccess

Allowed directives .htaccess, Tutorial

min video details
00:01 Directives allowed in .htaccess, Tutorial /Apache 2.2
00:06 These are all the directives that can be added within .htaccess
00:16 Although allowed, these directives can't be added in the .htaccess file unless the AllowOverride directive:
- either specifies the grouping of directives they belong to
00:36 - either has the value 'All'
00:43 Example:the "Allow" directive
00:53 the "Allow" directive is listed under the grouping of directives called "Limit"
00:59 → in order to be able to use it within .htaccess, the value of the AllowOverride directive must be either "Limit" either "All"
01:14 the web directory
01:17 AllowOverride All
AllowOverride Limit
01:27 also, the module "mod_authz_host" must be loaded
01:39 now we can add the Allow directive in .htaccess

For more information about the htaccess file, please see the spec: apache.org