Oracle iPlanet Web Proxy Server 4.0.14 Administration Guide

Managing URLs and URL Mappings

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.

Creating and Modifying URL 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:

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!

ProcedureTo create a URL mapping

  1. Access the Server Manager and click the URLs tab.

  2. Click the Create Mapping link.

    The Create Mapping page is displayed.

  3. 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

  4. 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.

  5. 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.

  6. Select the template name from the drop-down list, or leave the value at NONE if you do not want to apply a template.

  7. Click OK to create the mapping.

  8. Click Restart Required.

    The Apply Changes page is displayed.

  9. Click the Restart Proxy Server button to apply the changes.

ProcedureTo Change Your Existing Mappings

  1. Access the Server Manager and click the URLs tab.

  2. Click the View/Edit Mappings link.

    The View/Edit Mappings page is displayed.

  3. 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.

  4. Click Restart Required. The Apply Changes page is displayed.

  5. Click the Restart Proxy Server button to apply the changes.

ProcedureTo Remove a Mapping

  1. Access the Server Manager and click the URLs tab.

  2. Click the View/Edit Mappings link.

    The View/Edit Mappings page is displayed.

  3. Select the mapping to be removed, then click the Remove link next to it.

  4. Click Restart Required. The Apply Changes page is displayed.

  5. Click the Restart Proxy Server button to apply the changes.

Redirecting URLs

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.

ProcedureTo Redirect One or More URLs

  1. Access the Server Manager and click the URLs tab.

  2. Click the Redirect URLs link. The Redirect URLs page is displayed.

  3. Type a source URL that is a URL prefix.

  4. 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.

  5. Click OK.

  6. Click Restart Required.

    The Apply Changes page is displayed.

  7. Click the Restart Proxy Server button to apply the changes.