Livecode server configuration: tracking down and Apache redirect
Richard Gaskin
ambassador at fourthworld.com
Sun Dec 20 13:13:37 EST 2020
David Bovill wrote:
> The server return 400 Not Found when routing for a *.json file, while
> 200 OK when routing for a *.txt file - all other conditions seem the
> same.
...
> The .htaccess in the $DOCUMENT_ROOT folder does not mention json file
> endings.
Ah, we may have been looking at this backwards.
Rather than ask why Apache ISN'T serving JSON, we might ask why it SHOULD.
IIRC, following the general principle of least access Apache's defaults
serve only a small number of types, and additional types must be added
explicitly.
Just as we use directives to tell Apache to recognize the file type
".lc", you should be able to tell it to recognize .json by adding this
to Apache's config:
AddType application/json .json
Details here also show how to force UTF-8 for json, along with other tips:
https://htaccessbook.com/useful-htaccess-rules/
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list