NANOWEB, the aEGiS PHP web server
keeping apaches .htaccess files Features
NANOWEB uses a different configuration file layout (ini
style) than apache (markup style) does; also most of the directives names
differ.
This is no problem if you start with nanoweb or if you're going to switch to
nanoweb fully. However, when you need or want to switch between these two
webservers you need to take care, because apache throws an HTTP error 500 on
any directive found in one of the per-directory configuration files if it
doesn't know it. Nanoweb in contrast just ignores any directive it doesn't
know; so from it's point there is no problem at all.
However, as nanoweb per default looks for configuration directives in
.nwaccess and apache reads
.htaccess instead there's no
problem for the two different servers if you just place two versions in
every directory.
As there exists a few configuration directives in nanoweb that were designed
for compatibility with existing .htaccess files from apache
(
mod_rewrite for example), you may wish
nanoweb to read .htaccess files (
AccessFile
directive) and don't want to keep two concurrent versions up to date.
The solution to this problem is to prevent apache from reading configuration
directives it doesn't understand:
# following directives are understood by apache and nanoweb:
DirectoryIndex index.php index.pdf index.html
LanguagePriority ep en de fr es
RewriteRule ^file(.+)$ newpath/newfile$1 [NC]
# this is apache-specific and thus ignored by nanoweb
AddHandler cgi-script .bat
# apache will ignore everything in between following "tags",
# while nanoweb still notices it
<IfModule nanoweb>
# nanoweb version of AddHandler
ParseExt = .bat CGI C:\WINDOWS\COMMAND.COM $FILENAME
# multi-purpose http communication enhancement
AddHeader = X-Powered-by: beer
# and all others...
AllowExtSymLinks = 1
FbSortOrder = name
</IfModule>
(sample .htaccess file)
NANOWEB, the aEGiS PHP web server