For the complete Render documentation index, fetch https://render.com/llms.txt. Every docs page is also available as Markdown at https://render.com/docs/{slug}.md.

  • Docs
  • Changelog
Sign in
Get started

Static Site Redirects and Rewrites

View as Markdown
Open in ChatGPT
Open in Claude

You can add redirect and rewrite rules to your static sites in the Render Dashboard:

Setting redirect and rewrite rules in the Render Dashboard

When the path of an incoming request matches a rule's Source, Render automatically redirects or rewrites the request to the corresponding Destination. For details, see Rule matching and ordering.

You can't apply redirect/rewrite rules to your domain root.

Each Source requires at least one URL path component (such as /blog, or even /).

Which action to use?

Set each rule's Action to Redirect or Rewrite according to your needs:

ActionDescription

Redirect

Instructs the browser (or any other client) to switch URLs to the rule's destination via a 301 Moved Permanently response code.

Create a redirect rule if you're moving an existing resource from one path to another (for example, if you move your site's documentation content from /documentation to /docs).

Rewrite

Does not redirect the browser. Instead, your site serves the content from the rule's destination at the original path. The browser can't detect that content was served from a different path or URL.

Create a rewrite rule if:

  • You want to serve the same content from multiple paths.
  • Your static site uses a framework with client-side routing (such as react-router or Vue Router), and you'll handle all requests from a single path like /index.html.

Rule matching and ordering

Render does not apply redirect or rewrite rules to a path if a resource exists at that path. Instead, Render simply serves the resource at that path. This protects against overwriting valid paths with a rule, especially when using wildcards.

Here's what the full path-matching process looks like:

If this process results in a redirect to another site path, the process repeats with the new path.

Rule syntax

  • Source must be a path (not a full URL). This is matched against the path of the incoming request.
  • Destination can be either a path or a full, publicly accessible URL.

Basic examples

SourceDestination

/home

/

/blog/index.html

/blog

/web-host

https://render.com

Wildcards

Use a wildcard (*) to match arbitrary strings in a path.

  • In Source, * matches any string that appears starting at that position in the path.
    • Specify /* to match all paths.
  • In Destination, * applies the entire string captured by the wildcard in Source.
SourceDestinationExample Effect
/*/blog/*/path1/path2 → /blog/path1/path2
/*/index.htmlAll requests → /index.html

Placeholders

Use placeholders to include specific path components from Source in Destination:

SourceDestinationExample Effect
/blog/posts/:postid/blog/:postid/blog/posts/my-post → /blog/my-post
/updates/:month/:year/changelog/:year/:month/updates/03/2024 → /changelog/2024/03
View as Markdown
Open in ChatGPT
Open in Claude
Static Site Redirects and Rewrites
  • Which action to use?
  • Rule matching and ordering
  • Rule syntax
    • Basic examples
    • Wildcards
    • Placeholders
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits & pricing
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Upload & download files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • API keys
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render
All Systems Operational
© Render Inc. All rights reserved.