Skip to content
Craft plugin with link utility functions
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Updated icon.svg Aug 8, 2018 Initial commit Craft3 dev Aug 7, 2018
composer.json Assets obfuscator working, version bump Aug 8, 2018

Fix Me a Link for Craft 3

A Craft plugin with link utility functions.

Link Obfuscator for Assets Files

Using the following Twig filter in your template:

{% for asset in entry.assets %}
    <a href="{{ asset|obfuscateAssetUrl }}">{{ asset.extension }}</a>
{% endfor %}

will insert a database record with a unique hash for that URL, and provide a Craft URL with that hash. It will output the binary file under that URL to obfuscate its true location.

Obfuscated URLs expire in 15 minutes so they can't be shared.

We're using this on a community site for logged-in members with PDF files stored on Amazon S3, where we don't want those URLs getting out in the wild.

There's also a filter for:

<a href="{{ entry.url|obfuscate }}"

which will also store a link and a hash, but it currently just redirects to the URL when clicked.


Quick start to get this working for Assets on a client's site. More to come!

You can’t perform that action at this time.