URL storage
Every external address used in content, whether in a URL attribute or as a link in rich text, is stored once in a shared table of links (ezurl). The content itself holds only a reference to the row. This lets administrators see and correct every link of the site in one place and have the system check them regularly, without opening a single object.
How it works
- When an object is published, each address in its URL attributes and rich text is looked up in ezurl and added when it is new. The table ezurl_object_link records which object version uses which link.
- Changing an address in the link list (Setup > Link management, /url/list) changes it everywhere it is used, at once.
- Links between pages of the site itself are not stored here: rich text links to nodes and objects by their IDs, so they keep working when a page moves or is renamed.
Checking links
The cronjob linkcheck.php, in the infrequent part of cronjob.ini, checks the stored links and marks each one valid or invalid. It requests web addresses (HEAD, then GET), checks that the domain of an e-mail address accepts mail, and checks that addresses on the site itself exist. Answers such as 429 or 503 leave a link's state as it was. Private network addresses are never requested.
php runcronjobs.php -s <public siteaccess> --script=linkcheck.php
The link list shows each link's state, when it was last checked and which objects use it, and can be filtered to the invalid ones.
Effect on templates
A URL attribute whose link is marked invalid reports that it has no content: $attribute.has_content is false, so templates that test it leave the link out until it is valid again or corrected.
{if $node.data_map.website.has_content}
<a href="{$node.data_map.website.content|wash}">{$node.data_map.website.data_text|wash}</a>
{/if}
The link list, the checker's rules and URL aliases are described in the Links, URL aliases, wildcards and search statistics guide.
Contributors
- Balazs Halasy
- Geir Arne Waaler
- Graham Brookins Updated Maintainer
Comments
Add a comment