[{"data":1,"prerenderedAt":406},["ShallowReactive",2],{"helpers-navigation":3,"mdc-o8y00b-key":32,"helpers-version":74,"\u002Fdocs\u002Fhelpers\u002Fredirects":75,"\u002Fdocs\u002Fhelpers\u002Fredirects-surround":401},[4],{"title":5,"path":6,"stem":7,"children":8,"icon":31},"Helpers","\u002Fdocs\u002Fhelpers","1.docs\u002F8.helpers\u002F1.index",[9,11,15,19,23,27],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Environment Variables","\u002Fdocs\u002Fhelpers\u002Fenvironment-variables","1.docs\u002F8.helpers\u002F2.environment-variables",{"title":16,"path":17,"stem":18},"Meta Tags","\u002Fdocs\u002Fhelpers\u002Fmeta-tags","1.docs\u002F8.helpers\u002F3.meta-tags",{"title":20,"path":21,"stem":22},"Sitemap and robots.txt","\u002Fdocs\u002Fhelpers\u002Fsitemap","1.docs\u002F8.helpers\u002F4.sitemap",{"title":24,"path":25,"stem":26},"Redirects","\u002Fdocs\u002Fhelpers\u002Fredirects","1.docs\u002F8.helpers\u002F5.redirects",{"title":28,"path":29,"stem":30},"Vite","\u002Fdocs\u002Fhelpers\u002Fvite","1.docs\u002F8.helpers\u002F6.vite","i-ri-tools-line",{"data":33,"body":34},{},{"type":35,"children":36},"root",[37],{"type":38,"tag":39,"props":40,"children":41},"element","p",{},[42,45,54,56,63,65,72],{"type":43,"value":44},"text","Kirby Tools is built on ",{"type":38,"tag":46,"props":47,"children":51},"a",{"href":48,"rel":49},"https:\u002F\u002Fgetkirby.com",[50],"nofollow",[52],{"type":43,"value":53},"Kirby",{"type":43,"value":55}," – with gratitude to the team and community who make it. Help me improve the plugins: share feedback in ",{"type":38,"tag":46,"props":57,"children":60},{"href":58,"rel":59},"https:\u002F\u002Fgithub.com\u002Fkirby-tools\u002Fcommunity\u002Fdiscussions",[50],[61],{"type":43,"value":62},"Discussions",{"type":43,"value":64}," or report bugs via ",{"type":38,"tag":46,"props":66,"children":69},{"href":67,"rel":68},"https:\u002F\u002Fgithub.com\u002Fkirby-tools\u002Fcommunity\u002Fissues",[50],[70],{"type":43,"value":71},"Issues",{"type":43,"value":73},".",null,{"id":76,"title":24,"body":77,"description":395,"extension":396,"meta":397,"navigation":398,"path":25,"seo":399,"stem":26,"__hash__":400},"docs\u002F1.docs\u002F8.helpers\u002F5.redirects.md",{"type":78,"value":79,"toc":391},"minimark",[80,94,247,258,263,270,285,289,300,311,387],[39,81,82,83,87,88,93],{},"The ",[84,85,86],"code",{},"redirects"," option maps a ",[46,89,92],{"href":90,"rel":91},"https:\u002F\u002Fgetkirby.com\u002Fdocs\u002Fguide\u002Frouting#patterns",[50],"route pattern"," to a target. A rule fires only where Kirby would otherwise render the error page, so a page or route that exists is never redirected:",[95,96,102],"pre",{"className":97,"code":98,"filename":99,"language":100,"meta":101,"style":101},"language-php shiki shiki-themes github-light github-light github-dark","return [\n    'johannschopplich.helpers' => [\n        'redirects' => [\n            'about-us' => 'about',\n            'blog\u002F(:any)' => 'news\u002F$1',\n            'archive\u002F(:num)\u002F(:any)' => 'news\u002F$2?year=$1',\n            'work\u002F(:any)' => fn (string $slug) => page('projects')?->find($slug)?->url()\n        ]\n    ]\n];\n","site\u002Fconfig\u002Fconfig.php","php","",[84,103,104,117,129,139,153,166,179,229,235,241],{"__ignoreMap":101},[105,106,109,113],"span",{"class":107,"line":108},"line",1,[105,110,112],{"class":111},"s8jYJ","return",[105,114,116],{"class":115},"sxrX7"," [\n",[105,118,120,124,127],{"class":107,"line":119},2,[105,121,123],{"class":122},"sIIMD","    'johannschopplich.helpers'",[105,125,126],{"class":111}," =>",[105,128,116],{"class":115},[105,130,132,135,137],{"class":107,"line":131},3,[105,133,134],{"class":122},"        'redirects'",[105,136,126],{"class":111},[105,138,116],{"class":115},[105,140,142,145,147,150],{"class":107,"line":141},4,[105,143,144],{"class":122},"            'about-us'",[105,146,126],{"class":111},[105,148,149],{"class":122}," 'about'",[105,151,152],{"class":115},",\n",[105,154,156,159,161,164],{"class":107,"line":155},5,[105,157,158],{"class":122},"            'blog\u002F(:any)'",[105,160,126],{"class":111},[105,162,163],{"class":122}," 'news\u002F$1'",[105,165,152],{"class":115},[105,167,169,172,174,177],{"class":107,"line":168},6,[105,170,171],{"class":122},"            'archive\u002F(:num)\u002F(:any)'",[105,173,126],{"class":111},[105,175,176],{"class":122}," 'news\u002F$2?year=$1'",[105,178,152],{"class":115},[105,180,182,185,187,190,193,196,199,203,206,209,212,215,218,221,223,226],{"class":107,"line":181},7,[105,183,184],{"class":122},"            'work\u002F(:any)'",[105,186,126],{"class":111},[105,188,189],{"class":111}," fn",[105,191,192],{"class":115}," (",[105,194,195],{"class":111},"string",[105,197,198],{"class":115}," $slug) => ",[105,200,202],{"class":201},"snPdu","page",[105,204,205],{"class":115},"(",[105,207,208],{"class":122},"'projects'",[105,210,211],{"class":115},")",[105,213,214],{"class":111},"?->",[105,216,217],{"class":201},"find",[105,219,220],{"class":115},"($slug)",[105,222,214],{"class":111},[105,224,225],{"class":201},"url",[105,227,228],{"class":115},"()\n",[105,230,232],{"class":107,"line":231},8,[105,233,234],{"class":115},"        ]\n",[105,236,238],{"class":107,"line":237},9,[105,239,240],{"class":115},"    ]\n",[105,242,244],{"class":107,"line":243},10,[105,245,246],{"class":115},"];\n",[39,248,249,250,253,254,257],{},"Only ",[84,251,252],{},"GET"," requests are redirected, with status ",[84,255,256],{},"302",". Rules are tried in order, and the first match wins.",[259,260,262],"h2",{"id":261},"patterns","Patterns",[39,264,265,266,269],{},"A pattern is matched against the whole path, without the leading slash. Kirby's placeholders match one segment each, except ",[84,267,268],{},"(:all)",", which matches the rest of the path, slashes included.",[39,271,272,273,276,277,280,281,284],{},"Matching is case-sensitive. On a multi-language site, the path keeps its language prefix, so ",[84,274,275],{},"blog\u002F(:any)"," does not match ",[84,278,279],{},"\u002Fde\u002Fblog\u002Fpost"," – add a ",[84,282,283],{},"de\u002Fblog\u002F(:any)"," rule for it.",[259,286,288],{"id":287},"targets","Targets",[39,290,291,292,295,296,299],{},"A string target is a path or a full URL. ",[84,293,294],{},"$1",", ",[84,297,298],{},"$2",", and so on insert the segments the placeholders matched, in order.",[39,301,302,303,306,307,310],{},"A closure receives the matched segments as arguments and returns the target. One that returns ",[84,304,305],{},"null"," redirects nowhere, and the error page renders as usual. For a permanent redirect, call ",[84,308,309],{},"go()"," with the status yourself:",[95,312,314],{"className":97,"code":313,"filename":99,"language":100,"meta":101,"style":101},"return [\n    'johannschopplich.helpers' => [\n        'redirects' => [\n            'shop\u002F(:all)' => fn (string $path) => go('https:\u002F\u002Fshop.example.com\u002F' . $path, 301)\n        ]\n    ]\n];\n",[84,315,316,322,330,338,375,379,383],{"__ignoreMap":101},[105,317,318,320],{"class":107,"line":108},[105,319,112],{"class":111},[105,321,116],{"class":115},[105,323,324,326,328],{"class":107,"line":119},[105,325,123],{"class":122},[105,327,126],{"class":111},[105,329,116],{"class":115},[105,331,332,334,336],{"class":107,"line":131},[105,333,134],{"class":122},[105,335,126],{"class":111},[105,337,116],{"class":115},[105,339,340,343,345,347,349,351,354,357,359,362,365,368,372],{"class":107,"line":141},[105,341,342],{"class":122},"            'shop\u002F(:all)'",[105,344,126],{"class":111},[105,346,189],{"class":111},[105,348,192],{"class":115},[105,350,195],{"class":111},[105,352,353],{"class":115}," $path) => ",[105,355,356],{"class":201},"go",[105,358,205],{"class":115},[105,360,361],{"class":122},"'https:\u002F\u002Fshop.example.com\u002F'",[105,363,364],{"class":111}," .",[105,366,367],{"class":115}," $path, ",[105,369,371],{"class":370},"sBjJW","301",[105,373,374],{"class":115},")\n",[105,376,377],{"class":107,"line":155},[105,378,234],{"class":115},[105,380,381],{"class":107,"line":168},[105,382,240],{"class":115},[105,384,385],{"class":107,"line":181},[105,386,246],{"class":115},[388,389,390],"style",{},"html pre.shiki code .s8jYJ, html code.shiki .s8jYJ{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sxrX7, html code.shiki .sxrX7{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sIIMD, html code.shiki .sIIMD{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .snPdu, html code.shiki .snPdu{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBjJW, html code.shiki .sBjJW{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":101,"searchDepth":119,"depth":119,"links":392},[393,394],{"id":261,"depth":119,"text":262},{"id":287,"depth":119,"text":288},"Send requests for URLs that no page or route answers to a new address, matched with Kirby route patterns.","md",{},true,{"title":24,"description":395},"DIiUNXSLcoE0-sYRoURkW7hPoYExS0Vd3EeTLPqFUfY",[402,404],{"title":20,"path":21,"stem":22,"description":403,"children":-1},"Serve an XML sitemap with hreflang alternates for the languages each page is translated into, and a robots.txt that points to it.",{"title":28,"path":29,"stem":30,"description":405,"children":-1},"Load assets from the Vite dev server while it runs and the built, hashed files once a manifest exists – in templates and the Panel.",1791534960189]