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++


1. Order, Allow, Deny, SetEnvIf requirements


Share it

Intro / Requirements

The Order, Allow, Deny directives allow you to CONTROL ACCESS to your server or parts of your server.
The SetEnvIf directive can be used together with Order, Allow, Deny directives.

Requirements:

  1. Apache v2.2
  2. AccessFileName .htaccess (httpd-default.conf)
  3. Directives can be overidden through .htaccess (httpd.conf) if:
    • AllowOverride All or
    • AllowOverride Limit FileInfo
  4. Directives available under:
  5. mod_authz_host.so and mod_setenvif.so modules must be enabled on server (httpd.conf):
    • LoadModule authz_host_module modules/mod_authz_host.so
    • LoadModule setenvif_module modules/mod_setenvif.so

Observation

For "Host name" or "REMOTE_HOST" variable, the next Apache directive must be set to On (by default it's Off, httpd-default.conf):

HostnameLookups On


Video demonstration Order, Allow, Deny - Intro, Apache .htaccess file

Enable .htaccess file, Tutorial

min video details
00:01 Order, Allow, Deny, SetEnvIf directivesRequirements /Intro Tutorial
00:04 Order, Allow, Deny, directives allow you to CONTROL ACCESS to your server or parts of your server.
00:07 SetEnvIf directive can be used together with Order, Allow, Deny directives.
00:11 Order, Allow, Deny, SetEnvIf directives are allowed in .htaccess Apache v2.2.x.
00:35 You can add Order, Allow, Deny, SetEnvIf directives in your .htaccess if:
00:59 - if the directives can be overridden through .htaccess:
AllowOverride All
or
AllowOverride Limit FileInfo
01:28 - if the modules that provide them are loaded:
Order, Allow, Deny provided by mod_authz_host, loaded module
01:48 the directives simply block the access of all User Agents containing the word Trident (e.g. IE browser) to the server
01:55 Firefox allowed
02:04 IE denied (403 forbidden)

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