Users uploading a file within content create a name like my_site.com/sites/default/files/import/CrazyLongNamefile.pdf They would like to alias it for referencing in other media (print) like my_site.com/GoodName.pdf

URL alias works fine for other things, but not files (that I can determine)

The File (Field) module looks like it would probably do what I want, but it hasn't been touched for Drupal 8 in a while.

Is there a way (module, custom code) to provide an alternative path to a file that I can make available to content creators?

  • 1
    Do you absolutely have to have these aliases in the root? If not an easy solution be to rewrite everything from (e.g.) /assets/(.+) to /sites/default/files/$1 – Clive Mar 18 '19 at 16:42
  • This is what the client wants, yes. They want to be able to advertise in print an easy to get to URL – Doug Johnson-Cookloose May 2 '19 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.