Sun Java System Portal Server Secure Remote Access 7.2 Administration Guide

Configuring Rewriter in the Gateway Service

Using the Gateway service, under the Rewriter tab, you can perform the following tasks within two categories, Basic and Advanced:

Basic Tasks

ProcedureTo Enable the Gateway to Rewrite All URLs

If you enable the Enable Rewriting of All URIs option in the Gateway service, Rewriter rewrites any URL without checking against the entries in the Proxies for Domains and Subdomains list. Entries in the Proxies for Domains and Subdomains list are ignored.

  1. Log into the Portal Server administration console as administrator.

  2. Select the Secure Remote Access tab, and select the gateway profile for which you want to modify the attributes.

  3. Select the Rewriter tab.

  4. Under Basic Options, select the Enable Rewriting of All URIs checkbox to enable the Gateway to rewrite all URLs.

  5. Click Save to complete.

  6. Restart the Gateway from a terminal window:


    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>
    

ProcedureTo Specify the URIs Not to Rewrite

  1. Log into the Portal Server administration console as administrator.

  2. Select the Secure Remote Access tab, and select the gateway profile for which you want to set the attribute.

  3. Select the Rewriter tab.

  4. Under Basic Option, enter the URI in the Add text field and then click Add.

    The URI values is displayed in the URIs Not To Rewrite box.


    Note –

    Adding #* to this list allows URIs to be rewritten, even when the href rule is part of the ruleset.


  5. Click Save to complete.

  6. Restart the Gateway from a terminal window:


    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>
    

ProcedureTo Map a URI to a RuleSet

  1. Log into the Portal Server administration console as administrator.

  2. Select the Secure Remote Access tab, and select the gateway profile for which you want to set the attribute.

  3. Select the Rewriter tab.

  4. Under Rewriter Options, click Map URI to Rulesets, and click Add Row.

  5. Enter the required domain or host name in the URI field and the enter appropriate ruleset for the domain in the Rule Set field.

    The entry is added to the Map URIs to RuleSets list. The format for specifying the domain or host name and the ruleset is as follows:


    domain name|ruleset name

    For example:


    eng.sesta.com|default
  6. Click Save to Complete.

  7. Restart the Gateway from a terminal window:


    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>
    

ProcedureTo Specify MIME Mappings

Rewriter has four different parsers to parse the web pages based on the content type: HTML, JAVASCRIPT, CSS and XML. Common MIME types are associated with these parsers by default. You can associate new MIME types with these parsers in the Map Parser to MIME Types field of the Gateway service. This extends the Rewriter functionality to other MIME types.

Separate multiple entries with a semicolon or a comma (";" or ",".) For example:

HTML=text/html;text/htm;text/x-component;text/wml; text/vnl/wap.wml

means any content with these MIMEs are sent to the HTML Rewriter and HTML rules would be applied to rewrite the URLs.


Tip –

Removing unnecessary parsers from the MIME mappings list can increase the speed of operation. For example, if you are sure that the content from a particular intranet will not have any JavaScript, you can remove the JAVASCRIPT entry from the MIME mappings list.


  1. Log into the Portal Server administration console as administrator.

  2. Select the Secure Remote Access tab, and select the gateway profile for which you want to set the attribute.

  3. Select the Rewriter tab.

  4. Under Rewriter Option, click Map Parser to Map MIME Types .

    Specify the entry in the format HTML=text/html;text/htm

  5. Click Add Row to add the entry to the list. Enter the parser value and corresponding MIME value to map to in the MIME Type filed.

  6. Click Save to complete.

  7. Restart the Gateway from a terminal window:


    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>
    

ProcedureTo Specify the Default Domains

The default domain and subdomain are useful when URLs contain only the host names without the domain and subdomain. In this case, the Gateway assumes that the host names are in the default domain and subdomain, and proceeds accordingly.

For example, if the host name in the URL is host1, and the default domain and subdomain are specified as red.sesta.com, the host name is resolved as host1.red.sesta.com.

  1. Log into the Portal Server administration console as administrator.

  2. Select the Secure Remote Access tab, and select the gateway profile for which you want to set the attribute.

  3. Select Deployment Tab.

  4. In the Proxies for Domains and Subdomains field, type the required domain name with out proxy.

  5. Click Save to complete.

  6. Restart the Gateway from a terminal window:


    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>