PHPackages                             edulazaro/urlnormalizer - 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. edulazaro/urlnormalizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

edulazaro/urlnormalizer
=======================

A package to normalize URLs and filter URLs

v1.0.2(2y ago)03PHP

Since Apr 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/edulazaro/urlnormalizer)[ Packagist](https://packagist.org/packages/edulazaro/urlnormalizer)[ RSS](/packages/edulazaro-urlnormalizer/feed)WikiDiscussions main Synced today

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

URL Normalizer
==============

[](#url-normalizer)

 [![Total Downloads](https://camo.githubusercontent.com/2e82e4a33d1070ed5b097040adfa33b77f8de5d561b75ca70a6680e18006d93a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6564756c617a61726f2f75726c6e6f726d616c697a6572)](https://packagist.org/packages/edulazaro/urlnormalizer) [![Latest Stable Version](https://camo.githubusercontent.com/9eb4e653cc3d0aa60ef81a523be7df5f3c53c269af6f0cb18ac4e04d86d7cc63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6564756c617a61726f2f75726c6e6f726d616c697a6572)](https://packagist.org/packages/edulazaro/urlnormalizer)

Introduction
------------

[](#introduction)

URL nnormalizer allows to normalize a URL. A normalized URL refers to the format of a URL that has been standardized according to a set of rules. The purpose of URL normalization (or URL canonicalization) is to transform a URL into a normalized or canonical form. This way, URLs that are essentially identical but represented differently are considered equal by web servers or applications.

Normalization helps in reducing duplication of URLs where multiple URLs point to the same content. For instance, the following URLs might point to the same content but are represented differently:

For example, the URLs `http://edulazaro.com?a=1&b=2` and `http://edulazaro.com?b=2&a=1` are the same, and can be normalized to `http://edulazaro.com?a=1&b=2`.

The same happens with the URLs `http://edulazaro.com/` and `http://edulazaro.com`, where the forward slash is indifferent.

The same happens with dot segments like `/../` or `/./` and with the encoded unreserved characters like `%61`, which can be represented as an `a`.

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

[](#installation)

To install the package just execute this command:

```
composer require edulazaro/urlnormalizer
```

Usage
-----

[](#usage)

Just import the class `URLNormalizer` can use the `normalize` method:

```
use Edulazaro\URLNormalizer\URLNormalizer;

$normalizer = new URLNormalizer();

$normalizedURL = $normalizer->normalize('http://edulazaro.com?a=1&b=2');
```

You can also get the top domain of a URL by using the `getURLTopLevelDomain` method:

```
use Edulazaro\URLNormalizer\URLNormalizer;

$normalizer = new URLNormalizer();

$topDomain = $normalizer->getURLTopLevelDomain('http://test.edulazaro.com?a=1&b=2');
```

The class `URLCounter` is also included so you can count the number of unique normalized URLs in an array:

```
use Edulazaro\URLNormalizer\URLCounter;

$normalizer = new URLCounter();

$normalizedURLs = $normalizer->countUniqueUrls([
    'http://edulazaro.com?a=1&b=2',
    'http://edulazaro.com?a=2&b=1'
]);
```

Or you can also count them per top level domain:

```
use Edulazaro\URLNormalizer\URLCounter;

$normalizer = new URLCounter();

$normalizedURLsPerDomain = $normalizer->countUniqueUrlsPerTopLevelDomain([
    'http://test.edulazaro.com?a=1&b=2',
    'http://edulazaro.com?a=2&b=1',
    'http://neoguias.com'
]);
```

Testing
-------

[](#testing)

To test the package run `composer test`.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

2

Last Release

808d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a3c47449dfb2ec121aa410da024f47586b87cc2799a825f0418e6c5e5904955?d=identicon)[edulazaro](/maintainers/edulazaro)

---

Top Contributors

[![edulazaro](https://avatars.githubusercontent.com/u/7797530?v=4)](https://github.com/edulazaro "edulazaro (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/edulazaro-urlnormalizer/health.svg)

```
[![Health](https://phpackages.com/badges/edulazaro-urlnormalizer/health.svg)](https://phpackages.com/packages/edulazaro-urlnormalizer)
```

###  Alternatives

[fortawesome/font-awesome

The iconic font, CSS, and SVG framework

76.7k7.6M151](/packages/fortawesome-font-awesome)[htmlburger/carbon-fields-yoast

Helper library that allows developers to choose which fields from Carbon Fields to include in the Yoast readability score meter

114.4k](/packages/htmlburger-carbon-fields-yoast)

PHPackages © 2026

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