So the specific problem is that I want a file on my system to link to a http url, but fallback to a local version if there's no connection. The catch is that the program reading this file will be expecting css and so won't, by default, execute any access/fallback script I put in the file.
This got me thinking more generally:
When you access a php file on a webserver, before you read the file contents, the php script is interpreted. As far as any program accessing the file is concerned, the contents are the output (I know this only works because you are accessing it over http).
Does anyone know of an equivalent for local files? I'm aware that I could just setup apache and use a local http request to get exactly this behaviour from php, but I was interested to know if it was possible without that.
I am running Ubuntu 16.04 in case that makes a diference