Get Started

Configuration

You can customise Shortcut’s settings using a PHP configuration file. This is optional: each setting has a default, so you only need to include the values you want to change.

To override a setting, create shortcut.php in your Craft project’s /config directory and return an array of setting names and values. For example, the following will use go as the short-link URL segment:

<?php

return [
    'urlSegment' => 'go',
];

All other settings keep their defaults. Add any further settings you want to change to the same array. The options below explain the available settings and their defaults. You can also manage these settings in the control panel under Settings → Shortcut.

Configuration Options

urlSegment

Set the URL segment for links. e.g. my-site.test/s/xxxxx.

hideUrlSegment

Whether to hide the URL segment for links. e.g. my-site.test/xxxxx.

customDomain

Whether to use a custom domain name for links.

hashLength

Control the length of the unique hash.

provider

The provider used to create shortened URLs. Supported values are local, bitly, tinyurl, isgd, rebrandly, and shortio.

bitlyAccessToken

A Bitly access token, required when provider is set to bitly. Environment variables are supported.

rebrandlyApiKey

A Rebrandly API key, required when provider is set to rebrandly. Environment variables are supported.

rebrandlyDomain

An optional Rebrandly branded domain, such as rebrand.ly. Environment variables are supported.

rebrandlyWorkspaceId

An optional Rebrandly workspace ID for accounts with multiple workspaces. Environment variables are supported.

shortioApiKey

A Short.io API key, required when provider is set to shortio. Environment variables are supported.

shortioDomain

A Short.io domain, required when provider is set to shortio. Environment variables are supported.