Skip to main content

Configure redirects for a Datasette instance

Project description

datasette-redirects

PyPI Changelog Tests License

Configure redirects for a Datasette instance

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-redirects

Usage

Configure redirects in your datasette.yaml configuration file. Redirects are organized by HTTP status code:

plugins:
  datasette-redirects:
    301:
      old-page: https://example.com/new-page
      another-old-page: /new-location
    302:
      temporary-page: /temporary-location

This configuration will:

  • Redirect /old-page to https://example.com/new-page with a 301 (permanent) status
  • Redirect /another-old-page to /new-location with a 301 status
  • Redirect /temporary-page to /temporary-location with a 302 (temporary) status

Both /path and /path/ variants are matched automatically - you don't need to configure both.

Development

To set up this plugin locally, first checkout the code. You can confirm it is available like this:

cd datasette-redirects
# Confirm the plugin is visible
uv run datasette plugins

To run the tests:

uv run pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette_redirects-0.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasette_redirects-0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file datasette_redirects-0.1.tar.gz.

File metadata

  • Download URL: datasette_redirects-0.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for datasette_redirects-0.1.tar.gz
Algorithm Hash digest
SHA256 738b95de3cfec86859e0232e0878909587945b305753d6befc0745b36d2a8045
MD5 533441018e4be351785cb17bc1db4bfd
BLAKE2b-256 c855edc33646fe06bc57bc07773125bf3024a3801b7214cff57073e85312f6a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_redirects-0.1.tar.gz:

Publisher: publish.yml on datasette/datasette-redirects

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datasette_redirects-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_redirects-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c493ebe2ba27d294f3e1100b103f4213abebc2d9f2650444db964353a149772c
MD5 1955aa7f33d13bbe3dd4033aee2aee87
BLAKE2b-256 a0d0963cb4683f3657964471f6e1a81b22621199a374493e711902c357f7d0e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for datasette_redirects-0.1-py3-none-any.whl:

Publisher: publish.yml on datasette/datasette-redirects

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page