NANOWEB, the aEGiS PHP web server

.nwaccess - per-directory configuration files

Most of the configuration directives that are understood in the main server configuration file (/etc/nanoweb/nanoweb.conf) are also allowed to be used in the per-directory config files. The format of that files is the same as in the main server config file.

These files can be placed in every directory below the docroot and must have the filename set by the AccessFile directive (in main server config file); per default the name of these files is .nwaccess. In apache these files are called .htaccess, but as however only a few directives are fully equal to that of apache, you most likely want to have these different names for them; see apache compatibility issues if you would like to merge them.

example of a .nwaccess file:
# .nwaccess
# comments start with the hash sign

FBSortOrder = date desc
# will let the directory listing be ordered by modiftime, last first

ErrorDocument = 403 errorpage.html
# output customized error page

RewriteRule ^(*.tgz)$  /cgi-bin/log_download.php/$1  [nocase]
# binary files go through a .php script

If you give a directive in the .nwaccess file it will most likely override the one specified in the main server config file. This behaviour can be tweaked by setting AccessPolicy to block, override or merge. This default behaviour can then differ for some directives if you change it using AccessBlock, AccessOverride or AccessMerge.

Note that starting of nanoweb 1.8.1 you may omit the equal sign for assigning values to the directives. This is true for the main config file (nanoweb.conf), too.

NANOWEB, the aEGiS PHP web server