In a typical Server Accelerator configuration, there should be a reverse-map rule for every map rule, with the origin URL and replacement URL of the map rule reversed.

Examples of rules and translations

The following examples illustrate several important cases of rewrite rules.

Example 1 This map rule does not specify a path prefix in the target or replacement:

map http://www.x.com/ http:/server.hoster.com/x/

This rule results in the following translations:

User Request

Translated Request

 

 

http://www.x.com/Widgets/

http://server.hoster.com/x/Widgets/

index.html

index.html

 

 

http://www.x.com/cgi/form/

http://server.hoster.com/x/cgi/

submit.sh?arg=true

form.submit.sh?arg=true

 

 

Example 2 Map rules with path prefixes specified in the target:

map http://www.y.com/marketing http://marketing.y.com/

map http://www.y.com/sales http://sales.y.com

map http://www.y.com/engineering http://engineering.y.com/

map http://www.y.com/ http://info.y.com/

These rules result in the following translations:

User Request

Translated Request

 

 

http://www.y.com/marketing/projects/

http://marketing.y.com/projects/

manhattan/specs.html

manhattan/specs.html

 

 

http://www.y.com/marketing/projects/

http://info.y.com/marketing/projects/

boston/specs.html

boston/specs.html

 

 

http://www.y.com/engineering/

http://engineering.y.com/marketing/

marketing/requirements.html

requirements.html

 

 

Example 3 The order of the rules matters:

map http://www.g.com/ http://external.g.com/

map http://www.g.com/stuff http://stuff.g.com

These rules result in the following translation:

User Request

Translated Request

http://www.g.com/stuff/a.gif http://external.g.com/stuff/a.gif

Appendix A Caching Solutions and Performance

133

Page 145
Image 145
Intel 1520 manual Examples of rules and translations, User Request Translated Request