---json { "canonical": ":best:end:page:name", "h1": "ComboStrap URL Management - Best End Page Name Scoring", "name": "Best end page name algo", "page_id": "8krn9ufhknyscs432sd72" } --- ====== ComboStrap Routing - Best End Page Name Algorithm ====== ===== About ===== The ''Best End Page Name'' is a [[action|redirection scoring algorithm]] that finds the best page to redirect to when a [[404|non-existing page]] is requested. This algorithm performs the scoring by looping through the different part of a page name from the end to the beginning. For instance, if the page name was ''name1:name2:name3'', the algorithm would check first ''name3'', then ''name2'', then ''name1'' This concept comes from the fact that a content has a natural hierarchical structure. If you have created a page called ''bird:sparrow'': * there is a lot of chance that a page with the same last name (ie ''sparrow'') would be the good one * there is also even more chance if this page was in the same category ''bird'' * and so on. ===== Algorithm ===== When a user request a [[404|missing page]] (ie ''species:bird:sparrow''), the algorithm would: * search all pages with the same last name. * if there is no pages, returns and let the next [[action|redirection action]] takes place. * if it found pages. For instance, this two pages: * ''animal:bird:sparrow'' * ''europe:sparrow'' * it will score them by giving 1 point recursively for each matching name processing from the end to the beginning. For instance: * ''2'' point for ''animal:bird:sparrow'' (1 point for ''sparrow'' and 1 point for ''bird'') * ''1'' point for ''europe:sparrow'' * it will then select the page(s) with the highest score. * it will then select the page with the highest number of [[docs:navigation:backlink|backlinks]] * if the page has a score that is higher or equal to the [[#configuration|BestEndPageMinimalScoreForAlias configuration]]: * a [[docs:router:alias|alias redirect]] is created and a [[permanent|permanent redirect]] is performed. * otherwise an [[notfound|not found redirect]] is executed ===== Configuration ===== ==== BestEndPageMinimalScoreForAliasCreation ==== This [[docs:app:configuration|configuration]] permits to: * create a [[docs:router:alias#redirect|alias redirect]] * and executes a [[permanent|permanent redirect]] when the number of parts in the found path that matches the missing page is higher or equal. By default, this value is 2 but you can disable it by setting a value of 0. ==== Action Order ==== You can set the importance of this rule in the [[action#configuration|redirection action configuration]]. {{docs:router:best_end_page_name_configuration.png|}}