+ # Output the I·R·I redirection page
+ with open(f"{PUBLIC_DIRECTORY}/.lookup.xhtml", "w", encoding="utf-8") as f:
+ doc = getDOMImplementation().createDocument(None, "xml", None)
+ htmlElt = doc.documentElement
+ htmlElt.setAttribute("xmlns", XHTML_NAMESPACE)
+ htmlElt.setAttribute("lang", LANG)
+ headElt = htmlElt.appendChild(doc.createElement("head"))
+ titleElt = headElt.appendChild(doc.createElement("title"))
+ titleElt.appendChild(doc.createTextNode("Redirecting…"))
+ scriptElt = headElt.appendChild(doc.createElement("script"))
+ scriptElt.setAttribute("type", "text/javascript")
+ scriptElt.appendChild(doc.createTextNode(f"location={json.dumps(irimap)}[location.pathname.substring(1)]??`/`"))
+ bodyElt = htmlElt.appendChild(doc.createElement("body"))
+ bodyElt.appendChild(doc.createTextNode("Attempting to redirect to the proper page… (Requires Javascript.)"))
+ f.write(doc.toxml())
+