2

Is there a way to get "vanity URLs" for my assets? Something like:

www.example.com/download/asset.pdf

rather than:

www.example.com/several/subfolders/for/organisation/purposes/asset.pdf

I know that dumping all assets into a /download folder will work but this is far from an ideal solution. Is there another way?

1 Answer 1

5

Perhaps using redirects and Regex in your .htaccess? There's a Craft plugin that would help with this. https://github.com/rkingon/Craft-Plugin--Redirect-Manager/

You could use something like:

RedirectMatch 301 /download/(.*) /several/subfolders/for/organisation/purposes/$1 

You would need to refine this for matching several different subfolders.

1
  • Thank you for this. I asked the question and then kinda forgot about it. Commented Feb 24, 2015 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.