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(3mo ago)0820↓30.5%PHP

Since Apr 21Pushed 3mo 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 3w 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

35

—

LowBetter than 77% of packages

Maintenance82

Actively maintained with recent releases

Popularity19

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

95d 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

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

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

103519.9k57](/packages/friendsoftypo3-content-blocks)[typo3/cms-redirects

TYPO3 CMS Redirects - Create manual redirects, list existing redirects and automatically createredirects on slug changes.

167.4M81](/packages/typo3-cms-redirects)[typo3/cms-sys-note

TYPO3 CMS System Notes - Records with messages which can be placed on any page and contain instructions or other information related to a page or section.

116.3M39](/packages/typo3-cms-sys-note)[b13/assetcollector

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

10125.6k](/packages/b13-assetcollector)[dagger/dagger

Dagger PHP SDK

261.1k](/packages/dagger-dagger)

PHPackages © 2026

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