PHPackages                             sperelson/laravel-single-redirect - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. sperelson/laravel-single-redirect

ActiveLibrary[HTTP &amp; Networking](/categories/http)

sperelson/laravel-single-redirect
=================================

Adds ability to reduce multiple redirects down to one

0.4(2y ago)03MITPHPPHP ^8.1

Since Feb 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sperelson/laravel-single-redirect)[ Packagist](https://packagist.org/packages/sperelson/laravel-single-redirect)[ RSS](/packages/sperelson-laravel-single-redirect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Single Redirect
===============

[](#single-redirect)

Laravel Middleware Package
--------------------------

[](#laravel-middleware-package)

**Please do not use this on production - it doesn't even have tests!**

**Purpose:** Add a middleware to your Laravel project that will reduce redirect hops down to 1 redirect.

Sometimes, through no fault of your own, you can end up with redirects after redirects before your website's visitors finally end up on their destination page.

**Why:** SEO folk keep saying that a single redirect hop is better. This makes any SEO practitioner giddy and you didn't have to do anything difficult to combine all the possible redirect hops into a single one.

**How:** It works by placing itself (tries to anyway) as the last middleware and intercepts redirects. Upon intercepting a redirect, it creates an internal request to check if the next response is also a redirect. **Only works with GET requests!**

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

[](#installation)

composer require sperelson/laravel-single-redirect

Extra information
-----------------

[](#extra-information)

The package adds a header called `single-redirect` on each internal request. And inserts the `single-redirect` header into the final redirect response with the count of redirects. If `1` then it did not do anything for you. If the count is higher than `1` then it turned the response into a single redirect for the user.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Every ~0 days

Total

4

Last Release

807d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4815c4394d17968865e9d0f83405b742524c170a02b3f5be6c7afc0b1fee3cd5?d=identicon)[sperelson](/maintainers/sperelson)

---

Top Contributors

[![sperelson](https://avatars.githubusercontent.com/u/340138?v=4)](https://github.com/sperelson "sperelson (5 commits)")

---

Tags

middlewarelaravelredirectreduce

### Embed Badge

![Health badge](/badges/sperelson-laravel-single-redirect/health.svg)

```
[![Health](https://phpackages.com/badges/sperelson-laravel-single-redirect/health.svg)](https://phpackages.com/packages/sperelson-laravel-single-redirect)
```

###  Alternatives

[matthewbdaly/laravel-etag-middleware

A Laravel middleware for adding ETags to HTTP requests to improve response times

64326.0k2](/packages/matthewbdaly-laravel-etag-middleware)[tomschlick/request-migrations

HTTP Request Migrations

1844.5k](/packages/tomschlick-request-migrations)[shin1x1/laravel-force-https-url-scheme

Force https url schema middleware for Laravel 5

2726.6k](/packages/shin1x1-laravel-force-https-url-scheme)[brightfish/caching-guzzle

Cache HTTP responses through Guzzle middleware

1031.5k](/packages/brightfish-caching-guzzle)

PHPackages © 2026

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