---json { "canonical": ":best:page:name", "h1": "ComboStrap URL Management - Best Page Name", "name": "Best Page Name Algo", "page_id": "dpgszvs08798pxd1uudap" } --- ====== ComboStrap Routing - Best Page Name Algorithm ====== ===== About ===== ''Best Page Name'' is a [[action#scoring|scoring algorithm]] that is used to choose the target page to redirect to in case of [[404|missing page]]. This redirection algorithm performs always a [[docs:router:notfound|not found redirection]]. This algorithm should be in a low priority order because: * it does not execute any [[docs:router:permanent|permanent redirection]] * it performs less well than the [[docs:router:bestendpagename|best end page name]] ===== Algorithm ===== The redirection by best name page is an simple algorithm which occurs to find the best page by name. It calculate a score for two kinds of page : * the [[docs:page:system:index|home pages of a namespace]] * the pages with the same name ===== Configuration ===== A [[#weight factor]] [[docs:app:configuration|configuration]] is applied and in this way, you can influence the redirection : * When a page have the same name (by default 4) * When a page is a start page of a namespace (by default 3) * When a namespace match (by default 5) {{docs:router:best_page_name_weight_factor_conf.png|}} ===== Example ===== * The page asked : ''namespace1:namespace2:pagename'' * We have one page with the same name : ''namespace1:pagename'' * We have one startpage : ''namespace1:namespace2:start'' **Score :** * The score for the page with the same name is : 9 = 5 (because namespace1 is present in the asked page) + 4 (because the page name match) * The score for the startpage is : 13 = 5 (because namespace1 is present in the asked page) + 5 (because namespace2 is present in the asked page) + 3 (because it's a start page) In this case, the startpage is the redirect page because it have a highest score (13 against 9)