bolt/redirector

🔄 This Bolt extension adds redirects using YAML

Fund package maintenance!
bobvandevijver

Installs: 2 879

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 5

Open Issues: 0

Type:bolt-extension

pkg:composer/bolt/redirector

2.0.0 2026-01-19 08:39 UTC

This package is auto-updated.

Last update: 2026-01-19 08:42:38 UTC


README

Author: Ivo Valchev

Bolt Redirector is a Bolt CMS extension that performs simple URL redirects defined in a clean YAML config file.

Features

  • Define redirects in YAML (from → to).
  • Match redirects by either absolute path (/old-page) or full URL (https://example.org/old-page).
  • Configurable HTTP status code (default 302 / “Found”).
  • Avoids redirecting Bolt backend and async/admin requests.

Installation:

composer require bolt/redirector

Configuration

After installation, configure the extension using its config file (typically located under your project’s Bolt extensions config directory, depending on how your Bolt project is set up).

The extension ships with a config.yaml template that documents these options.

Example config.yaml

# Redirector extension configuration file

# Optional: status code for redirects
# Common values:
#  - 301 (permanent)
#  - 302 (temporary, default)
status_code: 301

redirects:
  # You can use an absolute path:
  /page/about: /page/about-us

  # You can also match a full URI (quote it because of ":" in "https://"):
  "https://example.org/page/mission": "/page/our-mission"

  # Trailing slashes are normalized, so these are treated the same:
  /blog: /news
  /blog/: /news/

Running Rector, PHPStan and Easy Codings Standard

First, make sure dependencies are installed:

COMPOSER_MEMORY_LIMIT=-1 composer update

And then run code quality checks:

  • vendor/bin/rector process -n --no-progress-bar --ansi
  • vendor/bin/phpstan analyse --ansi
  • vendor/bin/ecs check src --ansi