What would be the best way to map this URL to this filesystem path?
From
http://site.com/200x300/ed3269d0-f9ef-4ffc-abea-5982969876c0/my file.jpg
To
/var/www/e/d/3/ed3269d0-f9ef-4ffc-abea-5982969876c0/200x300.jpg
Where
- "200x300" is the size of the image
- "ed3269d0-f9ef-4ffc-abea-5982969876c0" is the guid of the image
- "my file" is the name of the file (used for SEO, may contain spaces)
- "e", "d" and "3" are the first 3 letters of the guid
- ".jpg" is the extension of the file
Try something like following:
Here's what I've come up (as I need to extract the extension too):