PingAccess

Rewrite rules overview

PingAccess allows for the manipulation of the Request URI, the cookie domain, the cookie path, three of the response headers (Location, Content-Location, and URI), and the response content.

For example, a site is hosted on https://server1.internalsite.com under /content/. Users access the site through the following Uniform Resource Locator (URL) in their browser: https://server1.internalsite.com/content/

For demonstration purposes, assume this results in a 302 Redirect to an importantContent.html page as well as setting a domain cookie for .internalsite.com. If you protect this site with PingAccess using the virtual host publicsite.com under the application /importantstuff/, you must rewrite the content. The information below discusses an example scenario.

This conceptual overview assumes that a virtual host, a site, and an application are already configured.

Create a Rewrite Content Rule

A rewrite content rule alters content in the HTTP response body.

  • In the Response Content-Types field, you define a response type of text/html.

  • In the Find and Replace criteria, you specify <a href="https://server1.internalsite.com/content/"> and <a href="https://publicsite.com/importantstuff/">.

  • Add the rule to the application. A query to a page with links in it that points to https://server1.internalsite.com/content/ now points to https://publicsite.com/importantstuff/.

A rewrite cookie domain rule allows the rewriting of the Domain field on cookies when they are set by the backend site.

  • In the server-facing cookie domain, you enter internalsite.com.

  • In the public-facing cookie domain, you enter publicsite.com.

  • Add the rule to the application.

    Cookies associated with the domain publicsite.com, or .publicsite.com, are rewritten to pertain to internalsite.com, or .internalsite.com.

A rewrite cookie path rule converts the cookie path returned by the site into a public-facing path.

Create a Rewrite Response Header Rule

A rewrite response header rule alters the response header used in the 302 Redirect.

Create a Rewrite URL Rule

A rewrite URL rule alters the request Uniform Resource Identifier (URI).