Use the Server Manager to map URLs to another server, sometimes called a mirror server. When a client accesses the proxy with a mirrored URL, the proxy retrieves the requested document from the mirrored server and not from the server specified in the URL. The client is never aware that the request is going to a different server. You can also redirect URLs. In this case, the proxy returns only the redirected URL to the client and not the document, so the client can then request the new document. Mapping also enables you to map URLs to a file, as in PAC and PAT mappings.
To map a URL, you specify a URL prefix and where to map it. The following sections describe the various types of URL mappings. You can create the following types of URL mappings:
Regular mappings map a URL prefix to another URL prefix. For example, you can configure the proxy to go to a specific URL any time it gets a request that begins http://www.example.com.
Reverse mappings map a redirected URL prefix to another URL prefix. These are used with reverse proxies when the internal server sends a redirected response instead of the document to the proxy. See Chapter 14, Using a Reverse Proxy for more information.
Regular expressions map all URLs matching the expression to a single URL. For example, you can map all URLs matching .*job.* to a specific URL, perhaps one that explains why the proxy server won’t let a user go to a particular URL.
Client autoconfiguration maps URLs to a specific .pac file stored on the proxy server. For more information on autoconfiguration files, see Chapter 17, Using the Client Autoconfiguration File.
Proxy array table (PAT) maps URLs to a specific .pat file stored on the proxy server. You should only create this type of mapping from a master proxy. For more information on PAT files and proxy arrays, see Routing Through Proxy Arrays.
Clients accessing a URL are sent to a different location on the same server or on a different server. This feature is useful when a resource has moved or when you need to maintain the integrity of relative links when directories are accessed without a trailing slash.
For example, suppose you have a heavily loaded web server called hi.load.com that you want mirrored to another server called mirror.load.com. For URLs that go to the hi.load.com computer, you can configure the proxy server to use the mirror.load.com computer.
The source URL prefix must be unescaped, but in the destination (mirror) URL, only characters that are illegal in HTTP requests need to be escaped.
Do not use trailing slashes in the prefixes!
Access the Server Manager and click the URLs tab.
Click the Create Mapping link.
The Create Mapping page is displayed.
Choose the type of mapping you want to create.
Regular Mappings. If you select this option, the following option is displayed in the lower section of the page:
Rewrite Host. Indicate whether the Host HTTP header is rewritten to match the host specified by the to parameter.
Reverse Mappings. Maps a redirected URL prefix to another URL prefix. If you select this option, the following option is displayed in the lower section of the page:
Rewrite Location. Indicate whether the Location HTTP response header should be rewritten.
Rewrite Content Location. Indicate whether the Content-location HTTP response header should be rewritten.
Rewrite Headername. Select the check box to indicate whether the headername HTTP response header should be rewritten, where headername is a user-defined header name.
Regular Expressions. Map all URLs matching the expression to a single URL. For more information on regular expressions, see Chapter 16, Managing Templates and Resources.
Client Autoconfiguration. Maps URLs to a specific .pac file stored on the Proxy Server. For more information on autoconfiguration files, see Chapter 17, Using the Client Autoconfiguration File.
Proxy Array Table (PAT). Maps URLs to a specific .pat file stored on the Proxy Server. You should only create this type of mapping from a master proxy. For more information on PAT files and proxy arrays, see “Routing through Proxy Arrays” in Chapter 12, Caching
Type the map source prefix.
For regular and reverse mappings, this prefix should be the part of the URL you want to substitute.
For regular expression mappings, the URL prefix should be a regular expression for all the URLs you want to match. If you also choose a template for the mapping, the regular expression will work only for the URLs within the template’s regular expression.
For client autoconfiguration mappings and proxy array table mappings, the URL prefix should be the full URL that the client accesses.
Type a map destination.
For all mapping types except client autoconfiguration and proxy array table, this declaration should be the full URL to which to map. For client autoconfiguration mappings, this value should be the absolute path to the .pac file on the proxy server’s hard disk. For proxy array table mappings, this value should be the absolute path to the .pat file on the master proxy’s local disk.
Select the template name from the drop-down list, or leave the value at NONE if you do not want to apply a template.
Click OK to create the mapping.
Click Restart Required.
The Apply Changes page is displayed.
Click the Restart Proxy Server button to apply the changes.
Access the Server Manager and click the URLs tab.
Click the View/Edit Mappings link.
The View/Edit Mappings page is displayed.
Click the Edit link next to the mapping to be modified. You can edit the prefix, the mapped URL, and template that are affected by the mapping. Click OK to confirm your changes.
Click Restart Required. The Apply Changes page is displayed.
Click the Restart Proxy Server button to apply the changes.
Access the Server Manager and click the URLs tab.
Click the View/Edit Mappings link.
The View/Edit Mappings page is displayed.
Select the mapping to be removed, then click the Remove link next to it.
Click Restart Required. The Apply Changes page is displayed.
Click the Restart Proxy Server button to apply the changes.
You can configure the proxy server to return a redirected URL to the client instead of getting and returning the document. With redirection, the client is aware that the URL originally requested has been redirected to a different URL. The client usually requests the redirected URL immediately. Netscape Navigator automatically requests the redirected URL. The user does not have to explicitly request the document a second time.
URL redirection is useful when you want to deny access to an area because you can redirect the user to a URL that explains why access was denied.
Access the Server Manager and click the URLs tab.
Click the Redirect URLs ink. The Redirect URLs page is displayed.
Type a source URL that is a URL prefix.
Type a URL to redirect to. This URL can either be a URL prefix or a fixed URL.
If you choose to use a URL prefix as the URL to redirect to, select the radio button next to the URL prefix field and type a URL prefix.
If you choose to use a fixed URL, select the radio button next to the Fixed URL field and type a fixed URL.
Click OK.
Click Restart Required.
The Apply Changes page is displayed.
Click the Restart Proxy Server button to apply the changes.