PHPackages                             sudhaus7/shortlink - 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. sudhaus7/shortlink

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

sudhaus7/shortlink
==================

A flexible url shortener for TYPO3, with FLUID ViewHelpers and Encodeservice

3.0.0(3y ago)431[1 issues](https://github.com/sudhaus7/typo3-shortlink/issues)MITPHPPHP 7.4.\* || 8.0.\* || 8.1.\*

Since Jun 5Pushed 3y ago2 watchersCompare

[ Source](https://github.com/sudhaus7/typo3-shortlink)[ Packagist](https://packagist.org/packages/sudhaus7/shortlink)[ Docs](https://github.com/sudhaus7/typo3-shortlink)[ RSS](/packages/sudhaus7-shortlink/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (13)Versions (18)Used By (0)

Shortcutlink (Shortlink)
========================

[](#shortcutlink-shortlink)

A urlshortener for TYPO3

What does it do:
----------------

[](#what-does-it-do)

This extension will create a short URL similar to bit.ly or similar services in an easy way. For the Integrator this means that the usual Viewhelpers for creating links have been extended and the shortener can be used transparently for any link created by a FLUID Viewhelper.

Additionaly a Service Class is available to create shortened URLs on the fly for example in a Plugin or in an Extbase Controller.

Available FLUID Viewhelpers
---------------------------

[](#available-fluid-viewhelpers)

Import the namespace like this:

```

```

or like this:

```
{namespace scl=SUDHAUS7\Shortcutlink\ViewHelpers}

```

The following ViewHelpers are available:

- uri.action
- uri.external
- uri.page
- uri.typolink
- link.action
- link.external
- link.page

these ViewHelpers have all attributes available and behave the same way as their normal counterparts, except they will produce a shortened url

That means you can now replace any

```
The link
```

simply with

```
The link
```

Usage in PHP
------------

[](#usage-in-php)

a simple example to shorten a URL:

```
$url = 'https://google.com/';
$shortener = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SUDHAUS7\Shortcutlink\Service\ShortlinkService::class);

$shortener->setUrl($url);
$shortlink = $shortener->getShorturlWithDomain();
```

Locking a shortend URL to a frontend user
-----------------------------------------

[](#locking-a-shortend-url-to-a-frontend-user)

It is possible to lock a frontend user ID to the shortened URL, which means that the short link can only be opened with an existing frontend user Session with the same user id

For this all ViewHelpers have an additional attribute `chainToUserid` which accepts the user id of the frontend user it has to be chained to.

For example:

```
The link
```

The resulting short link can only be opened if the user with the ID 42 is logged in.

The PHP equivalent to this would be:

```
$url = 'https://google.com/';
$shortener = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SUDHAUS7\Shortcutlink\Service\ShortlinkService::class);

$shortener->setUrl($url);
$shortener->setFeuser(42);
$shortlink = $shortener->getShorturlWithDomain();
```

REST Interface
--------------

[](#rest-interface)

The entrypoint you define in the extension-setup (default: /goto/) can be used as a Restful Interface API for creating, updating and deleting shortened URLs.

To enable this feature you need to go to the TYPO3 Backend and into the Settings Module and open the 'Configure Extensions' Dialog.

Here you open the configuration options of the 'shortcutlink' extension.

You will find a button 'generate a new API key'. Klick that Button and a new key will be generated. Make sure to copy it once it is generated, it can not be restored. Save the configuration after that.

This key can now be used for POST,PUT and DELETE operations by adding it as a header named 'ApiKey' to the HTTP Request header.

To create a new shortened url you will use the POST method without a key after /goto/

Here is an example with curl:

```
curl -X POST \
-d "url=https://google.com" \
-H "ApiKey: GTeZNuFWHfMxSTBf2krrasTCu9INcmHa5KwQ12uggDM" \
http://mysite/goto/
```

The response will be the shortlink URL as text/plain. For example:

```
http://mysite/goto/4J5tqQUkVnc

```

Alternatively you can use a json-encoded string as payload, if you set the Content-type to application/json. The answer will still be text/plain though:

```
curl -X POST \
-d '{"url":"https://google.com"}' \
-H "Content-type: application/json" \
-H "ApiKey: GTeZNuFWHfMxSTBf2krrasTCu9INcmHa5KwQ12uggDM" \
http://mysite/goto/
```

Possible fields in the payload are:

- url = the url to shorten (required)
- feuser = a frontenduser id this shortcode is locked to (optional)

Possible return codes are:

- 200 - Success
- 304 Forbidden - when the ApiKey is wrong or missing
- 500 Invalid Payload - when the payload is not valid

To update a shortened url you would use the PUT method on the shortened URL. PUT supports like POST a json encoded and a query encoded payload.

for example:

```
curl -X PUT \
-d '{"url":"https://bing.com"}' \
-H "Content-type: application/json" \
-H "ApiKey: GTeZNuFWHfMxSTBf2krrasTCu9INcmHa5KwQ12uggDM" \
http://mysite/goto/4J5tqQUkVnc
```

The body will simply contain `OK` on an successfull update. If the shortened URL is locked to a user, the userid needs to be provided as well. Only the URL can be updated, not the user.

Possible return codes are:

- 200 - Success
- 304 Forbidden - when the ApiKey is wrong or missing
- 500 Invalid Payload - when the payload is not valid
- 404 - if the shortened URL is not valid
- 403 - if a feuser has been provided but doesn't match the stored user

Respectively the method DELETE will delete a shortened url. DELETE does not require a payload.

```
curl -X DELETE \
-H "ApiKey: GTeZNuFWHfMxSTBf2krrasTCu9INcmHa5KwQ12uggDM" \
http://mysite/goto/4J5tqQUkVnc
```

The body will simply contain `OK` on an successfull delete.

Possible return codes are:

- 200 - Success
- 304 Forbidden - when the ApiKey is wrong or missing
- 404 - if the shortened URL is not valid

TODO: Documentation

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 93.1% 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 ~67 days

Recently: every ~239 days

Total

16

Last Release

1158d ago

Major Versions

1.2.4 → 2.0.02021-04-07

2.0.0 → 3.0.02023-03-14

PHP version history (2 changes)1.0.0PHP &gt;=7.2

3.0.0PHP 7.4.\* || 8.0.\* || 8.1.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9f3b5a9949724de5da93fcf1ea189dd31131a25502fb8555eb7cff3fab5cfad?d=identicon)[sudhaus7](/maintainers/sudhaus7)

---

Top Contributors

[![foppelfb](https://avatars.githubusercontent.com/u/7147768?v=4)](https://github.com/foppelfb "foppelfb (27 commits)")[![daylightsoftware](https://avatars.githubusercontent.com/u/63091806?v=4)](https://github.com/daylightsoftware "daylightsoftware (2 commits)")

---

Tags

urlshortenertypo3

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/sudhaus7-shortlink/health.svg)

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

###  Alternatives

[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

39488.5k](/packages/wazum-sluggi)[in2code/powermail

Powermail is a well-known, editor-friendly, powerful and easy to use mailform extension for TYPO3 with a lots of features

982.5M38](/packages/in2code-powermail)[internetgalerie/ig-slug

Rebuild URL slugs

12861.7k2](/packages/internetgalerie-ig-slug)[laracrafts/laravel-url-shortener

Powerful URL shortening tools in Laravel

97110.7k](/packages/laracrafts-laravel-url-shortener)[gallib/laravel-short-url

A Laravel package to shorten urls

16516.4k](/packages/gallib-laravel-short-url)[in2code/powermail_cond

Add conditions (via AJAX) to powermail forms for fields and pages

10530.6k](/packages/in2code-powermail-cond)

PHPackages © 2026

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