In my framework there is an advanced auto-loader which finds all used scripts (it's fast because path configuration is cached and refreshed only on changes). It works, and it doesn't generate performance costs greater than other common auto-loaders. So far so good.
I invented a solution to use RESTful URLs without <base> tag: to redirect all HTML requested files to PHP auto-loader, which returns the files via exit(file_get_contents($filename)).
I have a serious question: wouldn't it be a great performance cost if used to load images?
Is there a way to do it via .htaccess alone? Maybe script generated .htaccess would be the best? Is there a way to include a file in .htaccess? In case of any write error to this file a security risk may appear.
BTW, I expect moderate site load (about 1K users per day).