PHPackages                             a9f/typo3-better-redirects - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. a9f/typo3-better-redirects

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

a9f/typo3-better-redirects
==========================

Improved redirects handling for TYPO3, including optimized caching for large numbers of redirects

0.1.0(1mo ago)0487↓63.1%PHP

Since Apr 21Pushed 1mo agoCompare

[ Source](https://github.com/andreaswolf/typo3-better-redirects)[ Packagist](https://packagist.org/packages/a9f/typo3-better-redirects)[ RSS](/packages/a9f-typo3-better-redirects/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Better Redirects
================

[](#better-redirects)

A TYPO3 extension that replaces the built-in redirect matching with a multi-layer caching strategy optimized for large redirect sets (thousands of entries). Designed for TYPO3 13.4+ with the `redirects` system extension.

The Problem
-----------

[](#the-problem)

TYPO3's default `RedirectService` queries and evaluates all redirects on every request. This works fine for small sets but becomes a bottleneck at scale.

How It Works
------------

[](#how-it-works)

Redirect matching flows through three layers, each falling back to the next on a miss:

1. **Per-request result cache** — database-backed cache keyed by `(host, path, query)`, TTL up to 24 hours. Avoids repeated matching for frequently-hit URLs.
2. **PHP file cache** — redirect data is compiled into PHP files in `var/cache/code/better_redirects/` that are loaded and optimized by OPcache. Redirects are grouped by match type and organized into trie or hash structures for fast lookup. Files are sharded automatically when a type exceeds the threshold (default: 1,000 entries per type).
3. **TYPO3's default `RedirectService`** — fallback if the PHP file cache is unavailable or cold.

Cache invalidation is automatic: when a redirect record is saved or deleted via the TYPO3 backend, the result cache entries and the PHP file cache for that host are flushed immediately.

Important Notes
---------------

[](#important-notes)

> **The extension is active as soon as it is installed.** No configuration is required.

> **TYPO3's built-in redirect cache (`RedirectCacheService`) is superseded** by the PHP file cache and effectively becomes irrelevant. The built-in cache is still rebuilt on redirect changes (because the extension subclasses `RedirectCacheService`), but redirect matching never reaches it under normal operation.

> **The extension aliases `RedirectService` and `RedirectCacheService`** to its own subclasses via Symfony DI. Any code that injects these classes by their concrete TYPO3 type will transparently receive the caching variants.

Installation
------------

[](#installation)

```
composer require a9f/typo3-better-redirects
```

Activate the extension in the TYPO3 Extension Manager or via:

```
bin/typo3 extension:activate better_redirects
```

No additional configuration is required. The PHP file cache is populated automatically on the first request after installation (or after a cache flush).

Configuration
-------------

[](#configuration)

One optional setting is available via `$GLOBALS['TYPO3_CONF_VARS']`:

KeyDefaultDescription`EXTENSIONS/better_redirects/splitThreshold``1000`Number of redirects per match-type bucket above which the generated PHP file is split into shardsSet it in `config/system/additional.php` (or equivalent):

```
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['better_redirects']['splitThreshold'] = 500;
```

Requirements
------------

[](#requirements)

- TYPO3 13.4
- `typo3/cms-redirects` system extension
- PHP 8.2+
- OPcache recommended (the PHP file cache provides no benefit without it)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/159919?v=4)[Andreas Wolf](/maintainers/andreaswolf)[@andreaswolf](https://github.com/andreaswolf)

---

Top Contributors

[![andreaswolf](https://avatars.githubusercontent.com/u/159919?v=4)](https://github.com/andreaswolf "andreaswolf (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/a9f-typo3-better-redirects/health.svg)

```
[![Health](https://phpackages.com/badges/a9f-typo3-better-redirects/health.svg)](https://phpackages.com/packages/a9f-typo3-better-redirects)
```

###  Alternatives

[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

41515.2k](/packages/wazum-sluggi)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k44](/packages/friendsoftypo3-content-blocks)[praetorius/vite-asset-collector

Use AssetCollector to embed frontend assets generated by vite

54299.7k1](/packages/praetorius-vite-asset-collector)[b13/assetcollector

Asset collector - Add CSS and SVG files and strings as inline style tag/inline svg to the html code.

10123.2k](/packages/b13-assetcollector)[eliashaeussler/typo3-solver

Solver - Extends TYPO3's exception handling with AI generated solutions. Problems can also be solved from command line. Several OpenAI parameters are configurable and prompts and solution providers can be customized as desired.

292.1k](/packages/eliashaeussler-typo3-solver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
