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
Requires
- php: >=8.2
- twig/twig: ^3.21
Requires (Dev)
- bolt/core: ^6.0
- phpstan/extension-installer: 1.4.3
- phpstan/phpstan: 2.1.31
- phpstan/phpstan-deprecation-rules: 2.0.3
- rector/rector: 2.2.7
- symplify/easy-coding-standard: ^13
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 --ansivendor/bin/phpstan analyse --ansivendor/bin/ecs check src --ansi