> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filarank.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Redirect Manager & 404 Capture

> Log 404s in Laravel, create 301 redirects from the Filament SEO Health dashboard, and auto-redirect on slug change.

![FilaRank redirect manager with 404 capture and one-click 301 creation in Filament](https://mintcdn.com/filarank/wdcO8fk1ZIx84eRs/images/features/redirect-manager.png?fit=max\&auto=format\&n=wdcO8fk1ZIx84eRs\&q=85\&s=f95feeb742fa33b91548e5669ec46bb6)

`HandleRedirects` is registered on the web stack automatically. Set `FILARANK_AUTO_REDIRECTS=false` (or `redirects.auto_register_middleware`) to opt out.

If you already append it in `bootstrap/app.php`, remove the duplicate so 404s are not logged twice:

```php theme={null}
use Usamamuneerchaudhary\FilaRank\Http\Middleware\HandleRedirects;

->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [HandleRedirects::class]);
})
```

Publish and run the redirect migration (the installer does this for you), then register the plugin on your panel:

```php theme={null}
->plugin(\Usamamuneerchaudhary\FilaRank\FilaRankPlugin::make())
```

The middleware serves matching redirects (with normalisation, chain-following A→B→C, and loop protection) and logs every 404. Logged 404s appear on the **SEO Health** page with a one-click **Create redirect** link that pre-fills the source path. Rules are cached for an hour and the cache is busted automatically on create/edit/delete.

## Auto-redirects on slug change

Slug changes on published records create a 301 automatically. Reverting a slug clears the reverse rule, so renaming back and forth can't leave a redirect loop behind.

```php theme={null}
'redirects' => [
    'auto_on_slug_change' => true,
    'only_when_published' => true,
],
```

Override `HasSeo::isSeoPublished()` if your model uses a different published flag than `published_at` or a `status` of `published` / `live` / `public`.

Pair redirects with [Internal Linking](https://docs.filarank.com/internal-linking.md) and [Keyword Cannibalization](https://docs.filarank.com/cannibalization.md) reports on the same SEO Health dashboard to fix crawl and ranking issues in one place.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.