I'm mulling over what to do on a server that can't handle slasharguments, and therefore can't use "file.php" to serve up webpages that can cross-link or have embedded images, etc.
To recap: the problem is that if we have two files "a.html" and "b.html" in the same folder, they can't link to each other because the URL for the first one:
… … … ./file.php?file=/2/a.html
SHOULD link to
… … … ./file.php?file=/2/b.html
but it actually links to
… … … ./b.html
which gives a 404 error.
I had the bright idea of using the 404-handling error document to convert the mistaken URL to the other. A PHP file "404handler.php" is attached - if you place it in the root of your Moodle and then also add a line to .htaccess to specify 404handler.php as the ErrorDocument, it will attempt to point mistaken URLs to the correct place.
It seems to work. It's a bit of an ugly hack, but it means webpages can link to each other and to images etc. (One problem - it doesn't seem to work for embedded applets - I think Java refuses to follow the redirection.)
There's a variable "$moodleurl" in the script which needs changing to reflect your own moodle URL. Ideally I'd tidy that up to take the info from the config file …
Does this method sound sensible? Dangerous? Crafty? Stupid?