Belatedly getting redirects working
Posted by mholmes on 09 Apr 2018 in Activity log
JT pointed out that the redirect links are not working in the current MoEML, and on investigation it appears that we never implemented them at all. I did so, hastily:
- Each redirect (from redirects.xml) generates a special page with a meta refresh tag that points to the new URL; that will work on static versions of the site.
- An XQuery intervention in doc.xql in eXist notices such HTML content and intercepts it, sending a 301 instead; that will help with search engine index updating.
Took a while to figure out how to get the first part to be valid; it turns out that the single quotes that used to be normal around the URL are now invalid, and you need to provide this formulation:
<meta http-equiv="refresh" content="0; URL={$targId}.htm" />