Documentation | 2025.1

# Short links

Short links work with your Swarm installation's current hostname, but you have the option of registering/configuring an even shorter hostname to make shareable file/directory links as short as possible.

If you make a configuration change, Swarm will not use it until the configuration cache has been reloaded, this forces Swarm to use the new configuration. You must be an admin or super user to reload the Swarm config cache. Navigate to the User id dropdown menu, select System Information, click the Cache Info tab, and click the Reload Configuration button.

1. Register a short domain name, or if you control your own DNS server, a short domain name for your network.
2. Point the short domain name at your Swarm host.

3. Edit the `SWARM_ROOT/data/config.php` file and add the following configuration block:

       <?php
           // this block should be a peer of 'p4'
           'short_links' => array(
               'hostname'  => 'myho.st',
           ),

   Replace `myho.st` with the short domain name you registered/configured.

   If your Swarm is configured to use HTTPS, a custom port, a sub-folder, or any combination of these custom installation options, the short links configuration block should look like:

       <?php
           // this block should be a peer of 'p4'
           'short_links' => array(
               'external_url' => 'https://myho.st:port/sub-folder',
           ),

Replace `myho.st` with the short domain name you have registered/configured.

If you have not configured Swarm to use HTTPS, replace `https://` with `http://`.

If you have configured Swarm to run on a custom port, replace `:port` with the correct custom port. Otherwise, remove `:port`.

If you have configured Swarm to run in a sub-folder, replace `/sub-folder` with the correct sub-folder name. Otherwise, remove `/sub-folder`.

The `external_url` configuration item is only honored if you have also configured the `external_url` item within the `Environment` configuration item as well. Otherwise, Swarm could generate short links that cannot correctly link to their corresponding full URLs.

When `external_url` is configured, the `hostname` configuration item is ignored.

Your search for returned results