Routes

A route identifies one deployment on RTEdge.net: a host and an optional path, such as my-site or example.com/docs. Enter routes in the playground's Set Routes… dialog, or assign them through Code.D. This reference covers their syntax and normalization; Deploying to RTEdge.net explains how to publish to them.

Syntax

Write a route as host[/path], without https://. A host without a dot is shorthand for a subdomain of rt.ht: my-site/docs identifies https://my-site.rt.ht/docs/. A dotted host names a custom domain: example.com/docs identifies https://example.com/docs/.

The following grammar is a recommended subset for writing routes. The input field also accepts values it can normalize, as described below.

plain
route     = host [ "/" path ]
host      = label / hostname
hostname  = label *( "." label ) "." tld
label     = ALNUM [ *61( ALNUM / "-" ) ALNUM ]
tld       = 2*63ALPHA
path      = segment *( "/" segment )
segment   = 1*( ALNUM / "-" / "_" / "~" )
ALNUM     = ALPHA / DIGIT

ALPHA means an ASCII letter and DIGIT a digit. Square brackets mean optional, / separates alternatives, * allows repetition, and a number before it sets the minimum. A range such as 2*63 means 2 to 63 characters.

PartRecommended form
HostLabels of 1 to 63 letters, digits or hyphens, starting and ending with a letter or digit. Separate custom-domain labels with dots; keep the whole hostname within 253 characters.
PathNon-empty segments of letters, digits, -, _ or ~, separated by one slash. Path case is preserved.
EndingNo trailing slash, file name, worker suffix, query or fragment in the stored route.

A syntactically valid route still needs a host you can deploy to. Claiming an rt.ht name has additional length and reserved-name rules; custom domains need registration and DNS setup. See Domains and subdomains and Reserved paths.

Normalization

The playground normalizes route input before it stores it. These examples were checked against the current normalizer on 2026-10-13.

InputStored routeWhat changes
MY-SITE/Docsmy-site/DocsThe host is lowercased; the path keeps its case.
my-site.rt.ht/docsmy-site/docsThe .rt.ht ending is implied.
my-site//docs/my-site/docsRepeated slashes collapse and the trailing slash is removed.
example.com/docs/index.htmlexample.com/docsA final segment containing a dot is treated as a file name and removed.
my-site/docs/:api/usersmy-site/docsThe worker suffix beginning at : is removed.
example.com/docs?x=1#introexample.com/docsThe query and fragment are removed.
my site/docsmysite/docsWhitespace in the host is removed.
my-site/My Docsmy-site/My%20DocsA space in the path is percent-encoded.
bücher.de/docsxn--bcher-kva.de/docsAn internationalized host becomes Punycode.

Leading and trailing dots in the host are removed, and repeated host dots collapse. For new route names, use the recommended syntax above so the stored value is predictable.

Invalid and duplicate routes

The Routes field reports Invalid for an input it cannot accept and Duplicate when another entry has the same normalized value. Reading Code.D returns the unique, valid routes.

InputResult
Empty inputNo route: a host is required.
my-site/v1.2/guideInvalid: after normalization, a dot remains in a path segment.
my-site/docs and my-site.rt.ht/docs/Duplicate: both normalize to my-site/docs.

Note: A final dotted segment may be removed rather than rejected. For example, entering my-site/docs/index.html selects my-site/docs. Check the normalized route before deploying.

Examples

RoutePage URL
my-sitehttps://my-site.rt.ht/
my-site/docshttps://my-site.rt.ht/docs/
example.comhttps://example.com/
www.example.com/docs/api_v2https://www.example.com/docs/api_v2/

Set several routes to publish the same playground to each of them. Setting the route list does not deploy it, and removing an entry does not delete its existing deployment. See Choose routes and Code.D. The Editors list controls which other accounts may redeploy the routes.

Routes and request URLs

A route identifies the deployment; a request URL also chooses its page, a file or its worker. For the route my-site/docs:

URLWhat it selects
https://my-site.rt.ht/docs/The deployed page.
https://my-site.rt.ht/docs/app.jsThe app.js export, if one exists.
https://my-site.rt.ht/docs/:/api/usersThe route's worker, with pathname /api/users.
https://my-site.rt.ht/docs/sub/A separate deployment: my-site/docs/sub.

Path routes are independent: my-site/docs does not answer requests for the deployment my-site/docs/sub, even when the parent has a worker. There is no search through parent deployments. Write page URLs with a trailing slash and use worker URLs for paths handled by your worker.

Request routing explains URL redirects, exported-file matching, worker fallbacks and the order of platform features. URL suffixes covers source view, versions and the other actions available on deployed URLs.

See also