Rewrite filter (rewrite.nlm) configuration is accomplished via text files. An example of a configuration file is given below:
[Name=oraclefilter]
[Extension]
html, htm
[URL]
sjf-siva.sjf.novell.com/oracle/*
sjf-siva.sjf.novell.com/database/OracleQuery.html
sjf-siva.sjf.novell.com/oraclereports/
[Replace]
var xsport ="9003"<<>> var xsport ="443"
var xsname ="xyz01"<<>> var xsname ="www"
var xconnectMode = "http"<<>> var xconnectMode = "https"
<PARAM name=serverHost value="xyz01.novell.com"><<>><PARAM name=serverHost value="www.novell.com">
<PARAM name=serverPort value="9003"><<>><PARAM name=serverPort value="443">
<PARAM name=connectMode value="https"><<>><PARAM name=connectMode value="http"
[Name=<filtername>]: This is the name of the rewriter filter. It is used for filter identification in rwfilter commands.
[Extension]: The user can specify file extensions (in a single line) which need to be parsed. This section is optional, but if this section is not specified, all extension types will be parsed. Specifying this section will result in the parsing only specified extensions.
Conditions: All extensions should be specified in a single line (just after the Extensions section header). Individual extension elements should be separated by a comma.
For example:
[Extension]
html
Parses files with html extensions.
Parses http://www.novell.com/index.html.
Does not parse http://www.novell.com/logo.gif.
Does not parse http://www.novell.com.
[Extension]
html, htm, txt, ,
Parses files with extensions html, htm, txt, and any default files implied by a trailing slash (/).
Parses http://www.novell.com/license.txt.
Parses http://www.novell.com/.
Does not parse http://www.novell.com/logo.gif.
[URL]: This section lists all URLs to be parsed. The rules of URL specification are similar to the ACLCheck module as follows:
www.novell.com: Exact match
www.novell.com/contact/: All files in contact directory, but not in subdirectories.
www.novell.com/contact/*: All URLs starting with www.novell.com/contact, including subdirectories of contact.
[Replace]: The user can specify replacement pairs in this section. The string "<<>>" is used as a separator between the original string an the new string. The format is as follows:
[Replace]
<search string><<>><replacement string>
All the lines afer this Replacement section header will be treated as replacement string pairs, so this should be the last section in the file.
Conditions: The Replace section should be the last one in the file. Each replacement pair (including the last one) must be terminated with the end of the line.
The name of the filter module is REWRITE.NLM. Configuration files could be supplied as command line parameters to filter.
Filename restrictions: Rewrite.nlm does not place any restrictions on the configuration filename format, but files which do not conform to DOS filename format (8.3) format) could cause errors while loading the file.
Load Time Command Line Options: The load time command line option is: rewrite -s -f system/accell.rw -f etc/accel2.rw.
Options:
The following runtime console commands are also implemented:
The following are simple rules that the iChain rewrite filter uses:
[Replace]
DOG<<>>CAT
A<<>>O
If the original string is DOG, the rewritten string will be CAT. That is, only one replacement will occur (CAT will not be further replaced with CAT).
[Replace]
ABC<<>>XYZ
BCDEF<<>>PQRSTUVWXYZ
If the original string is ABCDEFGH, the replaced string is XYZDEFGH.
[Replace]
ABC<<>>XYZ
ABCDEF<<>>PQRSTUVWXYZ
If the original string is ABCDEFGH, the replaced string looks like PQRSTUVWXYZGH.