beautypg.com

Examples of rules and translations – Intel 1520 User Manual

Page 145

background image

Appendix A Caching Solutions and Performance

133

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:

This rule results in the following translations:

Example 2

Map rules with path prefixes specified in the target:

These rules result in the following translations:

Example 3

The order of the rules matters:

These rules result in the following translation:

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

User Request

Translated Request

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

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

http://www.x.com/cgi/form/
submit.sh?arg=true

http://server.hoster.com/x/cgi/
form.submit.sh?arg=true

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/

User Request

Translated Request

http://www.y.com/marketing/projects/
manhattan/specs.html

http://marketing.y.com/projects/
manhattan/specs.html

http://www.y.com/marketing/projects/
boston/specs.html

http://info.y.com/marketing/projects/
boston/specs.html

http://www.y.com/engineering/
marketing/requirements.html

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

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

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

User Request

Translated Request

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

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