View Single Post
Old 05-02-2022, 07:48 PM  
natkejs
Confirmed User
 
Industry Role:
Join Date: Jan 2003
Location: Nomad Land
Posts: 1,602
I think the easiest and fastest solution would be an internal URL rewrite.

domain.com/placeholder/<whatever>.jpg
to
domain.com/placeholder.jpg

RewriteEngine on
RewriteRule "^/placeholder/.+\.jpg$" "/placeholder.jpg" [PT]

Then you would just echo the page slug as the image name.

ie:
domain.com/placeholder/my-whatever-slug.jpg

Whether it's well invested time to set that up is for you to decide however ;)

Edit:
Just realized Directory and FallbackResource would be a better solution if talking Apache. Works out almost the same except your existing images and "dynamic placeholders" would exist in the same directory. Like the 404 solution suggested above but without 404 response codes.
__________________
natkejs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote