6.6. FiltersApache v2 introduced a new mechanism called a "Filter", together with a reworking of Multiviews. The documentation says:
There is a demonstration filter that changes text to uppercase. In .../site.filter/htdocs we have two files, 1.txt and 1.html, which have the same contents: HULLO WORLD FROM site.filter The Config file is as follows: User webuser Group webgroup Listen 80 ServerName my586 AddOutputFilter CaseFilter html DocumentRoot /usr/www/APACHE3/site.filter/htdocs If we visit the site, we are offered a directory. If we choose 1.txt, we see the contents as shown earlier. If we choose 1.html, we find it has been through the filter and is now all uppercase: HULLO WORLD FROM SITE.FILTER The Directives are as follows:
AddInputFilter filter[;filter...] extension [extension ...] directory, files, location, .htaccess AddInputFilter is only available in Apache 2.0.26 and later. AddInputFilter maps the filename extensions extension to the filter or filters that will process client requests and POST input when they are received by the server. This is in addition to any filters defined elsewhere, including the SetInputFilter directive. This mapping is merged over any already in force, overriding any mappings that already exist for the same extension. If more than one filter is specified, they must be separated by semicolons in the order in which they should process the content. Both the filter and extension arguments are case insensitive, and the extension may be specified with or without a leading dot.
AddOutputFilter filter[;filter...] extension [extension ...] directory, files, location, .htaccess AddOutputFilter is only available in Apache 2.0.26 and later. The AddOutputFilter directive maps the filename extensions extension to the filters that will process responses from the server before they are sent to the client. This is in addition to any filters defined elsewhere, including the SetOutputFilter directive. This mapping is merged over any already in force, overriding any mappings that already exist for the same extension. For example, the following configuration will process all .shtml files for server-side includes. AddOutputFilter INCLUDES shtml If more than one filter is specified, they must be separated by semicolons in the order in which they should process the content. Both the filter and extension arguments are case insensitive, and the extension may be specified with or without a leading dot.
SetInputFilter filter[;filter...] Server config, virtual host, directory, .htaccess The SetInputFilter directive sets the filter or filters that will process client requests and POST input when they are received by the server. This is in addition to any filters defined elsewhere, including the AddInputFilter directive. If more than one filter is specified, they must be separated by semicolons in the order in which they should process the content.
SetOutputFilter filter [filter] ... Server config, virtual host, directory, .htaccess The SetOutputFilter directive sets the filters that will process responses from the server before they are sent to the client. This is in addition to any filters defined elsewhere, including the AddOutputFilter directive. For example, the following configuration will process all files in the /www/data/ directory for server-side includes: <Directory /www/data/> SetOutputFilter INCLUDES </Directory> If more than one filter is specified, they must be separated by semicolons in the order in which they should process the content.
RemoveInputFilter extension [extension] ... directory, .htaccess RemoveInputFilter is only available in Apache 2.0.26 and later. The RemoveInputFilter directive removes any input filter associations for files with the given extensions. This allows .htaccess files in subdirectories to undo any associations inherited from parent directories or the server config files. The extension argument is case insensitive and can be specified with or without a leading dot.
RemoveOutputFilter extension [extension] ... directory, .htaccess RemoveOutputFilter is only available in Apache 2.0.26 and later. The RemoveOutputFilter directive removes any output filter associations for files with the given extensions. This allows .htaccess files in subdirectories to undo any associations inherited from parent directories or the server config files. The extension argument is case insensitive and can be specified with or without a leading dot. Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|