{"result":{"depiction_url":null,"edges":{"observes":{"objects":[{"created":"2026-09-09T13:47:43Z","object_id":{"id":1466,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_admin_menu","title":"observe_admin_menu\/3","uri":"https:\/\/zotonic.com\/id\/1466"},"seq":1},{"created":"2026-09-09T13:47:43Z","object_id":{"id":1817,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_dispatch_host","title":"observe_dispatch_host\/2","uri":"https:\/\/zotonic.com\/id\/1817"},"seq":2},{"created":"2026-09-09T13:47:43Z","object_id":{"id":2156,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_dispatch","title":"observe_dispatch\/2","uri":"https:\/\/zotonic.com\/id\/2156"},"seq":3}],"predicate":{"id":2550,"is_a":["meta","predicate"],"name":"observes","title":{"_type":"trans","tr":{"en":"Observes"}},"uri":"https:\/\/zotonic.com\/id\/observes"}},"references":{"objects":[{"created":"2020-05-30T05:47:49Z","object_id":{"id":1296,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_base","title":"mod_base","uri":"https:\/\/zotonic.com\/id\/1296"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:47:43Z","object_id":{"id":1296,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_base","title":"mod_base","uri":"https:\/\/zotonic.com\/id\/1296"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"relation":{"objects":[{"created":"2020-05-30T05:47:49Z","object_id":{"id":1541,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_dispatch_rules","title":{"_type":"trans","tr":{"en":"Follow a request to its template"}},"uri":"https:\/\/zotonic.com\/id\/1541"},"seq":1000000},{"created":"2020-05-30T05:47:49Z","object_id":{"id":1296,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_base","title":"mod_base","uri":"https:\/\/zotonic.com\/id\/1296"},"seq":1000000}],"predicate":{"id":303,"is_a":["meta","predicate"],"name":"relation","title":{"_type":"trans","tr":{"nl":"Relatie","en":"Relation"}},"uri":"http:\/\/purl.org\/dc\/terms\/relation"}},"subject":{"objects":[{"created":"2026-09-09T13:47:43Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:47:43Z","object_id":{"id":2562,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_site_administrator","title":"Site administrator","uri":"https:\/\/zotonic.com\/id\/2562"},"seq":2},{"created":"2026-09-09T13:47:43Z","object_id":{"id":2608,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_routing_and_redirects","title":"Routing and redirects","uri":"https:\/\/zotonic.com\/id\/2608"},"seq":3},{"created":"2026-09-09T13:47:43Z","object_id":{"id":2635,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_module","title":"Module","uri":"https:\/\/zotonic.com\/id\/2635"},"seq":4},{"created":"2026-09-09T13:47:43Z","object_id":{"id":2636,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_configure","title":"Configure","uri":"https:\/\/zotonic.com\/id\/2636"},"seq":5},{"created":"2026-09-09T13:47:43Z","object_id":{"id":2667,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_url","title":"URL","uri":"https:\/\/zotonic.com\/id\/2667"},"seq":6}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":1777,"is_a":["text","documentation","reference","module"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1777"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_module_mod_custom_redirect","page_url":{"en":"https:\/\/zotonic.com\/docs\/1777\/mod_custom_redirect","x-default":"https:\/\/zotonic.com\/docs\/1777\/mod_custom_redirect"},"preview_url":null,"resource":{"version":4037,"pivot_location_lat":null,"title":"mod_custom_redirect","is_authoritative":true,"body":"<p>Enables redirects from unknown hosts and paths to other locations. The other location can be a known path or another web site.<\/p>\n<h2>Redirect unknown domains<\/h2>\n<p>If the site dispatcher encounters an unknown host name then it notifies all modules with the <code>#dispatch_host<\/code> notification.<\/p>\n<p>The Custom Redirect module observes this notification and checks against a configurable list of domains and redirects.\nIf a domain is matched then the site dispatcher will redirect the user agent to the new location.<\/p>\n<p>The list of domains and their redirects can be configured in the admin: Modules -&gt; Domains and redirects.<\/p>\n<p>The domain must be like what is typed in the browser. Examples of domains are <code>www.example.org<\/code> and <code>mypc.local:8000<\/code>.<\/p>\n<p>Domain names are case insensitive, that is <code>WWW.EXAMPLE.COM<\/code> and <code>WwW.Example.coM<\/code> will both be matched with\n<code>www.example.com<\/code>. Contrary to the domain name, the path is case sensitive. That is <code>\/ABOUT<\/code> and <code>\/About<\/code> are two\ndifferent paths and will need their own redirect rules!<\/p>\n<p>The redirect location can be a complete URL (for example <code>http:\/\/www.example.com\/foo\/bar.html<\/code>) or a path (for example <code>\/about<\/code>).<\/p>\n<h2>Redirect unknown paths<\/h2>\n<p>After the site has been selected, the dispatcher matches the path to the dispatch rules.<\/p>\n<p>When no dispatch rule matches, then the <code>#dispatch<\/code> notification is sent. <a href=\"\/id\/doc_module_mod_base\" class=\"doc-reference doc-reference-module\"><code>module#mod_base<\/code><\/a>\nobserves that notification to check the path against the page_path properties of all resources. If it\ndoesn’t find a match then <a href=\"#mod-custom-redirect\">mod_custom_redirect<\/a> will\ncheck all custom redirect with an empty domain and a matching path. The visitor will be redirected to the corresponding\nredirect location.<\/p>\n<h2>Permanent or temporary redirects<\/h2>\n<p>A redirection can be permanent or temporary. A permanent redirect will be remembered by the visiting browser (and search\nengines), replacing any occurence of the redirected location. A temporary redirect will not be remembered and be retried\non every visit.<\/p>\n<h2>Accepted Events<\/h2>\n<p>This module handles the following notifier callbacks:<\/p>\n<ul><li><code>observe_admin_menu<\/code>: Add custom redirect management to the admin menu when permitted.<\/li><li><code>observe_dispatch<\/code>: Called when the path didn&#39;t match any dispatch rule using <code>m_custom_redirect:get_dispatch<\/code>.<\/li><li><code>observe_dispatch_host<\/code>: Called when the host didn&#39;t match any site config using <code>m_custom_redirect:list_dispatch_host<\/code>.<\/li><\/ul>\n<p>Delegate callbacks:<\/p>\n<ul><li><code>event\/2<\/code> with <code>submit<\/code> messages: <code>custom_redirects<\/code>.<\/li><\/ul>","slug":"mod_custom_redirect","doc_module_config":[],"is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"387180c1a291a2c64840089954e229e2447c3625024f009efd1a43ea0e7c2fd3","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":320,"is_a":["meta","category"],"name":"module","title":"Modules","uri":"https:\/\/test.zotonic.com\/id\/320"},"doc_source_path":"apps\/zotonic_mod_custom_redirect\/src\/mod_custom_redirect.erl","publication_start":"2023-06-24T08:18:03Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_custom_redirect\/src\/mod_custom_redirect.erl","pivot_location_lng":null,"doc_source_kind":"module","name":"doc_module_mod_custom_redirect","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:35Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_custom_redirect","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"28493fb676b2d92727e68d4fba20d89c56cf8ead\n","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-15T20:07:20Z","title_slug":"mod_custom_redirect"},"uri":"https:\/\/zotonic.com\/id\/1777","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1777"}},"status":"ok"}