{"id":50464515,"url":"https://github.com/glenscott/url-normalizer","last_synced_at":"2026-06-17T22:01:31.894Z","repository":{"id":1294078,"uuid":"1235568","full_name":"glenscott/url-normalizer","owner":"glenscott","description":"Syntax based normalization of URI's","archived":false,"fork":false,"pushed_at":"2023-11-05T11:36:21.000Z","size":67,"stargazers_count":101,"open_issues_count":12,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-04T14:27:46.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glenscott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2011-01-09T17:38:38.000Z","updated_at":"2026-02-01T14:15:30.000Z","dependencies_parsed_at":"2023-07-06T07:47:41.932Z","dependency_job_id":null,"html_url":"https://github.com/glenscott/url-normalizer","commit_stats":{"total_commits":61,"total_committers":7,"mean_commits":8.714285714285714,"dds":0.5573770491803278,"last_synced_commit":"7703bc184bf023b97d0361c513db0f37f01d06c2"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/glenscott/url-normalizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenscott%2Furl-normalizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenscott%2Furl-normalizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenscott%2Furl-normalizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenscott%2Furl-normalizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glenscott","download_url":"https://codeload.github.com/glenscott/url-normalizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glenscott%2Furl-normalizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34466930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-01T06:32:45.163Z","updated_at":"2026-06-17T22:01:31.888Z","avatar_url":"https://github.com/glenscott.png","language":"PHP","funding_links":[],"categories":["Table of Contents"],"sub_categories":["Globalization"],"readme":"\n# Syntax based normalization of URI's\n\nThis normalizes URI's based on the specification RFC 3986 \nhttps://tools.ietf.org/html/rfc3986\n\n### Example usage\n\n```php\nrequire_once 'vendor/autoload.php';\n\n$url = 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d';\n$un = new URL\\Normalizer( $url );\necho $un-\u003enormalize();\n\n// Result: 'example://a/b/c/%7Bfoo%7D'\n```\n\n### The normalization process preserves semantics\n\nSo, for example, the following URL's are all equivalent.\n\n- `HTTP://www.Example.com/` and `http://www.example.com/`\n- `http://www.example.com/a%c2%b1b` and `http://www.example.com/a%C2%B1b`\n- `http://www.example.com/%7Eusername/` and `http://www.example.com/~username/`\n- `http://www.example.com` and `http://www.example.com/`\n- `http://www.example.com:80/bar.html` and `http://www.example.com/bar.html`\n- `http://www.example.com/../a/b/../c/./d.html` and `http://www.example.com/a/c/d.html`\n- `http://www.example.com/?array[key]=value` and `http://www.example.com/?array%5Bkey%5D=value`\n\n### Normalizations performed\n\n1. Converting the scheme and host to lower case\n1. Capitalizing letters in escape sequences\n1. Decoding percent-encoded octets of unreserved characters\n1. Adding trailing `/`\n1. Removing the default port\n1. Removing dot-segments\n\nFor more information about these normalizations, please see the following Wikipedia article:\n\nhttp://en.wikipedia.org/wiki/URL_normalization#Normalizations_that_Preserve_Semantics\n\nFor license information, please see LICENSE file.\n\n### Options\n\nTwo options are available when normalizing URLs which are disabled by default:\n\n1. Remove empty delimiters.  Enabling this option would normalize `http://www.example.com/?` to `http://www.example.com/`  Currently, only the query string delimiter (`?`) is supported by this option.\n2. Sort query parameters.  Enabling this option sorts the query parameters by key alphabetically.  For example, `http://www.example.com/?c=3\u0026b=2\u0026a=1` becomes `http://www.example.com/?a=1\u0026b=2\u0026c=3`\n\n### TODO\n\nAdd further scheme-based normalization steps, as detailed in section 6.2.3 of the RFC.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglenscott%2Furl-normalizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglenscott%2Furl-normalizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglenscott%2Furl-normalizer/lists"}