Skip to main content

What You’ll Achieve

After completing these steps, visitors to https://yourdomain.com/license.xml will receive your RSL license XML from Supertab Connect servers, while the URL stays on your domain. No redirects, completely transparent. Your existing site remains completely unchanged.

How It Works

When a user requests /license.xml:
  1. CloudFront matches the /license.xml cache behavior
  2. A CloudFront Function rewrites the path to include your merchant URN
  3. CloudFront fetches the license from Supertab Connect
  4. The response is cached and returned to the user
Your other paths (/, /api/*, etc.) continue working exactly as before.

Setup Steps

1

Create CloudFront Function

1

Navigate to Functions

  1. Log into AWS Console
  2. Go to CloudFront service
  3. In the left sidebar, click Functions
  4. Click Create function
2

Configure Function

Enter the following:
  • Name: supertab-rewrite-license-path
  • Description: Rewrites /license.xml to supertab-connect path
  • Runtime: cloudfront-js-2.0
Click Create function
3

Add Function Code

In the function editor, replace all existing code with:
function handler(event) {
    var request = event.request;
    var originalUri = request.uri;

    var merchantURN = 'YOUR_MERCHANT_SYSTEM_URN';

    request.uri = '/merchants/systems/' + merchantURN + originalUri;

    return request;
}
Replace YOUR_MERCHANT_SYSTEM_URN with your actual System URN from the Supertab Connect dashboard.Example: urn:stc:merchant:system:1311ad62-d7da-41d3-9ddb-1079330fdd9c
4

Test the Function (Recommended)

  1. Click Test tab
  2. Click Edit JSON, change the "uri" field to "/license.xml"
  3. Click Test function
  4. Verify the output shows your rewritten path
5

Save and Publish

  1. Click Save changes
  2. Click Publish tab
  3. Click Publish function
2

Add Supertab Connect Origin

1

Open Your Distribution

  1. Go to CloudFrontDistributions
  2. Click on your distribution
  3. Click Origins tab
2

Create New Origin

Click Create origin and configure:
SettingValue
Origin domainapi-connect.supertab.co
ProtocolHTTPS only
HTTPS port443
Minimum origin SSL protocolTLSv1.2
Origin pathLeave empty
Namesupertab-connect-origin
Click Create origin
3

Create Cache Behavior

1

Navigate to Behaviors

  1. Click Behaviors tab
  2. Click Create behavior
2

Configure Path and Origin

SettingValue
Path pattern/license.xml
Origin and origin groupssupertab-connect-origin
3

Configure Viewer Settings

SettingValue
Viewer protocol policyRedirect HTTP to HTTPS
Allowed HTTP methodsGET, HEAD
Restrict viewer accessNo
4

Configure Cache Settings

SettingValue
Cache policyCachingOptimized
Origin request policyAllViewerExceptHostHeader
Use AllViewerExceptHostHeader, NOT “AllViewer”. Using “AllViewer” causes 502 errors.
5

Associate CloudFront Function

Scroll to Function associations
SettingValue
Viewer request - Function typeCloudFront Functions
Viewer request - Function ARN/Namesupertab-rewrite-license-path
6

Create and Verify Order

  1. Click Create behavior
  2. Verify /license.xml appears above the default * behavior
  3. If not, select it and click Move Up
4

Deploy and Wait

After creating the behavior, your distribution status changes to Deploying.
  • CloudFront is copying your function to all edge locations worldwide
  • This takes 10-15 minutes
Wait for status to change from DeployingDeployed
5

Test Your Setup

Do not test until status is “Deployed”
  1. Open https://yourdomain.com/license.xml in your browser
  2. Verify you see your RSL license XML
  3. Check the URL bar shows your domain, not ours

You’re Done!

Your RSL license is now published at https://yourdomain.com/license.xml. Bots and AI agents can access your licensing terms directly from your domain. The final step is updating your robots.txt so bots know where to find it.

Next Steps

Update robots.txt

Add the License directive so bots can discover your license.