Manual:Thumb handler.php

Description
thumb_handler.php is a script to be used as 404 handler to create and stream out a not yet existing image thumbnail.

To use it, follow the steps below, then set   to false. If you have   defined in LocalSettings.php, then you need to also set:

Apache
Create a rewrite rule to call thumb_handler.php when a file in /thumb/ doesn't exist. If your wiki is in the /w directory, something like this should work on apache: