---
title: "Static routes"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:sitehandling-staticroutes@main"
source: "ApiOverview/SiteHandling/StaticRoutes.rst"
rendered: "2026-09-20T15:52:37+00:00"
---

# Static routes {#sitehandling-staticroutes}

Static routes provide a way to create seemingly static content on a per site
base. Take the following example: In a multi-site installation you want to have
different `robots.txt` files for each site that should be reachable at
`/robots.txt` on each site. Now, you can add a static route `robots.txt`
to your site configuration and define which content should be delivered.

Routes can be configured as top level files (as in the `robots.txt` case),
but may also be configured to deeper route paths
(`my/deep/path/to/a/static/text`, for example). Matching is done on the
full path, but without any parameters.

Static routes can be configured via the user interface or directly in the YAML
configuration. There are two options: deliver static text or resolve a TYPO3 URL.

> [!NOTE]
> Static route resolving is implemented as a
> [PSR-15 middleware](https://docs.typo3.org/permalink/t3coreapi:request-handling@main). If the route path requested
> matches any one of the configured site routes, a response is directly
> generated and returned. This way there is minimal bootstrap code to be
> executed on a static route resolving request, mainly the site configuration
> needs to be loaded. Static routes cannot get parameters, as the matching is
> done solely on the path level.

## `staticText` {#sitehandling-static-routes-statictext}

The `staticText` option allows to deliver simple text content. The text
can be added through a text field directly in the site configuration. This is
suitable for files like `robots.txt` or `humans.txt`.

A configuration example:

**config/sites/\<some_site>/config.yaml | typo3conf/sites/\<some_site>/config.yaml**

```yaml
routes:
  - route: robots.txt
    type: staticText
    content: |
      Sitemap: https://example.org/sitemap.xml
      User-agent: *
      Allow: /
      Disallow: /forbidden/

```

## Static routes to assets {#static-routes-to-assets}

The type `assets` allows to expose
resources which are typically located in the directory
`EXT:my_extension/Resources/Public/`.

A configuration example:

**config/sites/\<some_site>/config.yaml | typo3conf/sites/\<some_site>/config.yaml**

```yaml
routes:
  - route: example.svg
    type: asset
    asset: 'EXT:backend/Resources/Public/Icons/Extension.svg'
  - route: favicon.ico
    type: asset
    asset: 'EXT:my-sitepackage/Resources/Public/Icons/favicon.ico'

```

This enables you to reach the files at `https://example.org/example.svg`
and `https://example.org/favicon.ico`.

The asset URL is configured on a per-site basis.
This allows to deliver site-dependent custom favicon or manifest
assets, for example.

## TYPO3 URL (t3://) {#sitehandling-static-routes-typo3-url-t3}

The type `uri` for a TYPO3 URL provides the option to render either a
file, page or URL. Internally, a request to the file or URL is done and its
content delivered.

A configuration example:

**config/sites/\<some_site>/config.yaml | typo3conf/sites/\<some_site>/config.yaml**

```yaml
routes:
  - route: sitemap.xml
    type: uri
    source: 't3://page?uid=1&type=1533906435'
  - route: favicon.ico
    type: uri
    source: 't3://file?uid=77'

```
