Check if an URL shortener does its job.

There are different scenarios why you should check the functionality of your URL shortener. For example a new VirtualHost on your webserver or some DB-changes or own PHP-hacks or -patches might break the shortener. If you maintain lots of services it’s likely that you forget to manually check the functionality of your software, so this plugin will help you! Of course you can also check foreign shorteners, whether some shortened URL’s are still accessible.

To check the shortener provide a shortened URL with --short :

usr@srv % ./ --short
redirecting works perfectly: 301 -> /

You can also check if the redirection is as expected. Provide an expected target with --expect :

usr@srv % ./ --short --expect /
redirecting works perfectly: 301 -> /

To run this plugin you need to install curl! This plugin just downloads the header of the shortened URL and makes sure the response code is 301. If you provide an expectation it additionally compares it with the new location.

Here is the code.


Please consider to take a look at my general setup notes.

Download: Perl: (Please take a look at the man-page. Browse bugs and feature requests.)

Martin Scharm

stuff. just for the records.

Do you like this page?
You can actively support me!

Leave a comment

There are multiple options to leave a comment: