PHPackages                             milon/jigsaw-url-shortener - 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. milon/jigsaw-url-shortener

ActiveLibrary

milon/jigsaw-url-shortener
==========================

A URL Shortener for your Jigsaw powered website

v1.0.0(1y ago)1651—0%MITBlade

Since Aug 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/milon/jigsaw-url-shortener)[ Packagist](https://packagist.org/packages/milon/jigsaw-url-shortener)[ RSS](/packages/milon-jigsaw-url-shortener/feed)WikiDiscussions master Synced 1mo ago

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

jigsaw-url-shortener
====================

[](#jigsaw-url-shortener)

[![banner](/jigsaw-url-shortener.png)](/jigsaw-url-shortener.png)

Getting Started
---------------

[](#getting-started)

This can be used to host several link if you already have a [Jigsaw](https://jigsaw.tighten.com) powered site. Let's say you have various social links and you want a easy way to share all of those. Rather than remember all the different username and url patterns or these different website, you can now have a consistent format.

For example, you have a twitter, linkedin and facebook page. Each of them has different url pattern, but now you can use a common pattern. For instance, if my website's url is `http://milon.im`, now I can have `http://milon.im/twitter`, `http://milon.im/facebook` and `http://milon.im/linkedin` and these will redirect to the origin website.

#### Requirements

[](#requirements)

- PHP 8.1 or higher
- Jigsaw 1.7 or higher

#### Installation

[](#installation)

```
composer require milon/jigsaw-url-shortener
```

Setup and Usage
---------------

[](#setup-and-usage)

First you need to create a new entry in config file named `urlRedirects`.

```
[
    ...,
    'urlRedirects' => [
        [
            'filename' => 'twitter',
            'url' => 'https://twitter.com/to_milon',
        ],
        [
            'filename' => 'github',
            'url' => 'https://github.com/milon',
        ],
    ],
    ...
]
```

#### Alternative way

[](#alternative-way)

For easier readability, I recommend export this config to a separate file. You can create a file named `redirects.php` in the root folder, which should look like this-

```
