PHP. Indeed. I was thinking of that as a way to write the file from an 'install' page (at present there is no install page - the user manually edits a 'settings' file before installing). I think this is probably the solution for the redirects. The hostname can be detected without the user needing to enter it, although I agree it could be entered manually.