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.
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.