PHPackages                             mdf/php-url-resolver - 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. mdf/php-url-resolver

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

mdf/php-url-resolver
====================

URLResolver in php that attempts to resolve URLs to the final destination

347.8k11PHP

Since Apr 30Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mdf092/URLResolver.php)[ Packagist](https://packagist.org/packages/mdf/php-url-resolver)[ RSS](/packages/mdf-php-url-resolver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

Welcome to URLResolver.php
==========================

[](#welcome-to-urlresolverphp)

URLResolver.php is a PHP class that attempts to resolve URLs to a final, canonical link. On the web today, link shorteners, tracking codes and more can result in many different links that ultimately point to the same resource. By following HTTP redirects and parsing web pages for open graph and canonical URLs, URLResolver.php attempts to solve this issue.

Patterns Recognized
-------------------

[](#patterns-recognized)

- Follows 301, 302, and 303 redirects found in HTTP headers
- Follows [Open Graph](https://developers.facebook.com/docs/opengraph/) URL &lt;meta&gt; tags found in web page &lt;head&gt;
- Follows [Canonical](http://www.google.com/support/webmasters/bin/answer.py?answer=139394) URL &lt;link&gt; tags found in web page &lt;head&gt;
- Follows URL in refresh meta tag
- Aborts download quickly if content type is not an HTML page

I am open to additional suggestions for improvement.

Usage
-----

[](#usage)

Resolving a URL can be as easy as:

```
