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.
-
Register a short domain name, or if you control your own DNS server, a short domain name for your network.
-
Point the short domain name at your Swarm host.
-
Edit the
file and add the following configuration block:SWARM_ROOT
/data/config.php<?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 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://
withhttp://
.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
.Important
The
external_url
configuration item is only honored if you have also configured theexternal_url
item within theenvironment
configuration item as well. Otherwise, Swarm could generate short links that cannot correctly link to their corresponding full URLs.When
external_url
is configured, thehostname
configuration item is ignored.