websites: add multilingual support to the error document handling

Signed-off-by: Gregory Bartholomew <gregory.lee.bartholomew@gmail.com>
This commit is contained in:
Gregory Bartholomew 2025-04-03 13:15:37 +00:00 committed by kevin
parent 9f04ee6386
commit 524a4c901e

View file

@ -1,6 +1,12 @@
DocumentRoot /srv/web/fedoraproject.org/
ErrorDocument 404 /404.html
SetEnvIf Request_URI "^/([[:alpha:]]{2,3}(?:-[[:alpha:]]{2,4})?)/" LANGUAGE=$1
<If "-n '%{env:LANGUAGE}' && -f '%{CONTEXT_DOCUMENT_ROOT}/%{env:LANGUAGE}/404/index.html'">
ErrorDocument 404 /%{env:LANGUAGE}/404/index.html
</If>
<Else>
ErrorDocument 404 /404.html
</Else>
FileETag MTime Size