PHPackages                             divineomega/seo-middleware - 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. divineomega/seo-middleware

Abandoned → [jord-jd/seo-middleware](/?search=jord-jd%2Fseo-middleware)Library[Utility &amp; Helpers](/categories/utility)

divineomega/seo-middleware
==========================

SEO Middleware - middleware to redirect to HTTPS when in production, and remove www. from URLs

v3.1.0(3w ago)6370LGPL-3.0-onlyPHPPHP &gt;=5.5.9CI passing

Since Sep 1Pushed 3w agoCompare

[ Source](https://github.com/Jord-JD/SEO-Middleware)[ Packagist](https://packagist.org/packages/divineomega/seo-middleware)[ Docs](https://github.com/Jord-JD/SEO-Middleware)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-seo-middleware/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (9)Dependencies (3)Versions (10)Used By (0)

SEO Middleware
==============

[](#seo-middleware)

This package contains middleware classes for Laravel 5 through 13 that add common canonical URL redirects without raising the PHP 5.5.9 minimum.

Features
--------

[](#features)

- Permanently redirecting production HTTP requests to HTTPS
- Permanently removing a leading `www.` host label while preserving the path, query string, and port
- Middleware classes can be applied global or to specific routes

Quick Start
-----------

[](#quick-start)

1. Run `composer require jord-jd/seo-middleware`.
2. In the `$middleware` array in your `app/Http/Kernel.php` file:

- For HTTP to HTTPS redirects, add `\JordJD\SeoMiddleware\Http\Middleware\HttpsOnly::class`.
- For removal of `www.` from requests, add `\JordJD\SeoMiddleware\Http\Middleware\RemoveWww::class`.

3. Remember to set the `APP_ENV` variable to `prod` (in the project's `.env` file) when the application is running in production. Some middleware will only function when this is set to allow for easier local development.

Available Middleware Classes
----------------------------

[](#available-middleware-classes)

Any of these middleware classes can be used globally, by adding them to the `$middleware` array in `apps/Http/Kernel.php` file. They can also be used on a per route basis, by adding them to the `$routeMiddleware` array in the same file and then associated them with a route in your `apps/Http/routes.php`file.

### HttpsOnly Middleware

[](#httpsonly-middleware)

The `HttpsOnly` middleware will redirect any HTTP request to their HTTPS equivalents. The security of websites is becoming an ever increasing ranking signal for search engine rankings.

The HTTP to HTTPS redirect will only take place if the application environment is set to `prod` (production), to aid with local development environments in the setup of HTTPS can be difficult and in many cases unnecessary. Changing this setting can be set in your project's `.env` file, as shown in the example extracts below.

```
APP_ENV=local # Local development (redirect disabled)

```

```
APP_ENV=prod  # Production use (redirect enabled)

```

### RemoveWww Middleware

[](#removewww-middleware)

The `RemoveWww` middleware will check for `www.` within the URL of any requests made to your web application and then redirect them to a version of the URL without the `www.` removed. This can be beneficial for SEO purposes by the potential for similar URLs to be indexed with the same content.

Only a leading `www.` host label is removed; `www.` text in paths or query values is left untouched. This redirect will occur regardless of the application environment (`APP_ENV`) setting.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~451 days

Recently: every ~743 days

Total

9

Last Release

27d ago

Major Versions

v1.1.0 → v2.0.02026-02-14

v2.0.0 → v3.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (10 commits)")

---

Tags

https-redirectlaravel-5-packagelaravel-middlewaremiddlewareseoseo-middlewarehttpsmiddlewaresslwwwredirectseoSEO middleware

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/divineomega-seo-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-seo-middleware/health.svg)](https://phpackages.com/packages/divineomega-seo-middleware)
```

###  Alternatives

[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

604.0k2](/packages/crumbls-layup)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[aerni/advanced-seo

Comprehensive SEO addon for Statamic with flexibility in mind

1818.9k](/packages/aerni-advanced-seo)[yaroslawww/laravel-force-https

Easy redirect to https for Laravel.

129.7k](/packages/yaroslawww-laravel-force-https)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.8k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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