[{"data":1,"prerenderedAt":940},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fgetting-started\u002Fredirects":3,"docs-navigation":781,"docs-surround-\u002Fdocs\u002Fgetting-started\u002Fredirects":937},{"id":4,"title":5,"body":6,"description":770,"extension":771,"icon":772,"meta":773,"navigation":774,"path":775,"seo":776,"sitemap":777,"stem":778,"updated":779,"__hash__":780},"docs\u002Fdocs\u002F1.getting-started\u002F5.redirects.md","Redirects",{"type":7,"value":8,"toc":752},"minimark",[9,13,17,36,39,70,75,81,117,120,125,161,165,172,212,234,256,260,270,280,287,311,317,321,410,421,425,485,488,492,506,515,522,528,534,538,555,558,562,565,568,582,586,598,602,608,625,630,634,654,697,718,730,733],[10,11,5],"h1",{"id":12},"redirects",[14,15,16],"p",{},"When a page moves, a redirect sends visitors and search engines from its old URL to the new one, so links keep working and the page keeps its search ranking.",[14,18,19,20,24,25,30,31,35],{},"Redirects work on your own custom domains, not on ",[21,22,23],"code",{},"hostsmith.link"," addresses. ",[26,27,29],"a",{"href":28},"\u002Fdocs\u002Fgetting-started\u002Fcustom-domains","Add a custom domain"," and create the site on it first. To forward a hostname that has no site, such as a domain you no longer use, create a ",[26,32,34],{"href":33},"#forward-a-domain-with-a-redirect-host","redirect host"," instead.",[14,37,38],{},"A site's rules come from two places:",[40,41,42,60],"ul",{},[43,44,45,49,50,54,55,59],"li",{},[46,47,48],"strong",{},"User rules",", which you add in the dashboard, or through the ",[26,51,53],{"href":52},"\u002Fdocs\u002Fdevelopers","API"," and ",[26,56,58],{"href":57},"\u002Fdocs\u002Fmcp\u002Ftools","AI agents",". They are kept on the site, and a deploy doesn't change them.",[43,61,62,69],{},[46,63,64,65,68],{},"A ",[21,66,67],{},"_redirects"," file"," in your site, whose rules go live with each deploy.",[71,72,74],"h2",{"id":73},"add-rules-in-the-dashboard","Add rules in the dashboard",[14,76,77,78,80],{},"In the dashboard's sites list, choose a site's ",[46,79,5],{}," action. The panel lists the site's rules in the order they are checked.",[40,82,83,93,96,102,111],{},[43,84,85,88,89,92],{},[46,86,87],{},"Add rule"," opens a row for the old path, where to send it, and the status code. ",[46,90,91],{},"Done"," checks the rule.",[43,94,95],{},"On each rule's row, you can move it up or down, edit it, or delete it.",[43,97,98,101],{},[46,99,100],{},"Save"," applies all your changes together, within about 5 minutes.",[43,103,104,107,108,110],{},[46,105,106],{},"Edit as text"," shows the rules as ",[21,109,67],{}," lines, for many changes at once.",[43,112,113,116],{},[46,114,115],{},"Test a path"," shows which rule answers a path, and where it sends visitors. While you have unsaved changes, it tests those.",[14,118,119],{},"If someone else saves the rules while you edit them, Save says so, and offers to load their version.",[121,122,124],"h3",{"id":123},"import-and-export","Import and export",[40,126,127,147],{},[43,128,129,132,133,136,137,54,140,143,144,146],{},[46,130,131],{},"Export"," saves the user rules as a CSV with the columns ",[21,134,135],{},"from",", ",[21,138,139],{},"to",[21,141,142],{},"status",", or as ",[21,145,67],{}," lines to put in your site.",[43,148,149,152,153,157,158,160],{},[46,150,151],{},"Import"," reads the same CSV, or ",[26,154,156],{"href":155},"#from-webflow","Webflow's export",". It shows the rules, and each row it can't use with the reason, before saving anything. Once you confirm, the imported rules replace the user rules, and the rows with errors are left out. The ",[21,159,67],{}," rules don't change.",[71,162,164],{"id":163},"forward-a-domain-with-a-redirect-host","Forward a domain with a redirect host",[14,166,167,168,171],{},"A redirect host is a hostname on one of your custom domains that has no site: it answers only with its user rules. Use one to forward a domain you no longer use to your new one, or for short campaign links such as ",[21,169,170],{},"go.example.com\u002Fspring",".",[173,174,175,186,189],"ol",{},[43,176,177,178,181,182,185],{},"In the sites list, choose ",[46,179,180],{},"Add",", then ",[46,183,184],{},"Redirect",". The choice shows once one of your custom domains is active.",[43,187,188],{},"Choose its address.",[43,190,191,192,195,196,199,200,203,204,207,208,211],{},"To send every path to another site, fill in ",[46,193,194],{},"Forward every path to",", such as ",[21,197,198],{},"https:\u002F\u002Fnew-brand.com",". That saves the rule ",[21,201,202],{},"\u002F* https:\u002F\u002Fnew-brand.com\u002F:splat",", so ",[21,205,206],{},"www.old-brand.com\u002Fpricing?utm_source=mail"," goes to ",[21,209,210],{},"https:\u002F\u002Fnew-brand.com\u002Fpricing?utm_source=mail",". Leave it empty to add your own rules in the Redirects panel, which opens next.",[14,213,214,215,218,219,222,223,207,226,229,230,171],{},"A path that no rule matches gets the not-found page. To forward the bare domain too, create the redirect host at ",[21,216,217],{},"www"," with ",[46,220,221],{},"Serve at apex",": a visitor to ",[21,224,225],{},"old-brand.com\u002Fpricing",[21,227,228],{},"www.old-brand.com\u002Fpricing"," first, then to the destination, as described in ",[26,231,233],{"href":232},"#the-bare-domain","The bare domain",[14,235,236,237,239,240,242,243,246,247,250,251,255],{},"A redirect host has no files, so it takes no deploys and no ",[21,238,67],{}," file, and it can't have access control. It doesn't count toward your plan's site limit, and an organization can have up to 50. Through the ",[26,241,53],{"href":52},", create one as a site with ",[21,244,245],{},"kind"," set to ",[21,248,249],{},"redirect","; an ",[26,252,254],{"href":253},"\u002Fdocs\u002Fmcp\u002Ftools#create_site","AI agent"," can create one too. Delete it like a site, from the sites list.",[71,257,259],{"id":258},"add-a-_redirects-file","Add a _redirects file",[14,261,262,263,265,266,269],{},"Put a file named ",[21,264,67],{}," at the root of your site, next to ",[21,267,268],{},"index.html",", and deploy. Write one rule per line:",[271,272,278],"pre",{"className":273,"code":275,"language":276,"meta":277},[274],"language-text","# The blog moved to \u002Fnews\n\u002Fblog\u002F*      \u002Fnews\u002F:splat\n\u002Fabout-us    \u002Fabout\n\u002Fpricing     https:\u002F\u002Fshop.example.com\u002Fplans   302\n","text","",[21,279,275],{"__ignoreMap":277},[14,281,282,283,286],{},"Each line is the old path, where to send it, and an optional status code, separated by spaces. Lines that start with ",[21,284,285],{},"#"," are comments.",[40,288,289,292,299,305],{},[43,290,291],{},"The rules go live with the deploy, and a later deploy without the file has no rules.",[43,293,294,295,298],{},"The file itself is never served: ",[21,296,297],{},"\u002F_redirects"," is not-found.",[43,300,301,302,304],{},"In a ZIP, put it at the root, or in the single top folder if the ZIP has one. A ",[21,303,67],{}," in any other folder is an ordinary file.",[43,306,307,308,310],{},"A deploy of only a ",[21,309,67],{}," file is fine: it publishes the rules, with no pages.",[14,312,313,314,316],{},"Netlify and Cloudflare Pages read the same format, so a ",[21,315,67],{}," file from either works for the rules on this page.",[71,318,320],{"id":319},"paths","Paths",[40,322,323,338,365,384,397],{},[43,324,325,328,329,332,333,54,335,171],{},[46,326,327],{},"Exact paths"," match with or without a trailing slash: ",[21,330,331],{},"\u002Fabout-us"," matches ",[21,334,331],{},[21,336,337],{},"\u002Fabout-us\u002F",[43,339,340,136,343,346,347,350,351,136,354,207,357,360,361,364],{},[46,341,342],{},"A splat",[21,344,345],{},"*"," as the last part of the path, matches the path and everything under it. In the destination, ",[21,348,349],{},":splat"," is the rest of the path: with ",[21,352,353],{},"\u002Fblog\u002F* \u002Fnews\u002F:splat",[21,355,356],{},"\u002Fblog\u002F2024\u002Frye",[21,358,359],{},"\u002Fnews\u002F2024\u002Frye",". ",[21,362,363],{},"\u002F*"," matches every path.",[43,366,367,370,371,374,375,136,378,207,381,171],{},[46,368,369],{},"Placeholders"," such as ",[21,372,373],{},":slug"," match one part of the path, between two slashes: with ",[21,376,377],{},"\u002Fposts\u002F:slug \u002Farticles\u002F:slug",[21,379,380],{},"\u002Fposts\u002Ffresh-rye",[21,382,383],{},"\u002Farticles\u002Ffresh-rye",[43,385,386,389,390,393,394,171],{},[46,387,388],{},"Case"," matters, as it does for files: ",[21,391,392],{},"\u002FTeam"," doesn't match ",[21,395,396],{},"\u002Fteam",[43,398,399,402,403,406,407,171],{},[46,400,401],{},"Encoded characters"," match as the visitor's browser shows them, so ",[21,404,405],{},"\u002Füber-uns"," matches a link to ",[21,408,409],{},"\u002F%C3%BCber-uns",[14,411,412,413,416,417,420],{},"The destination is a path on your site, or a full ",[21,414,415],{},"https:\u002F\u002F"," or ",[21,418,419],{},"http:\u002F\u002F"," URL. Placeholders can fill in a destination's path or query, never its domain.",[71,422,424],{"id":423},"status-codes","Status codes",[426,427,428,441],"table",{},[429,430,431],"thead",{},[432,433,434,438],"tr",{},[435,436,437],"th",{},"Code",[435,439,440],{},"Use it for",[442,443,444,453,461,469,477],"tbody",{},[432,445,446,450],{},[447,448,449],"td",{},"301",[447,451,452],{},"A page that moved for good. The default when a line has no code.",[432,454,455,458],{},[447,456,457],{},"302",[447,459,460],{},"A page that moved for a while",[432,462,463,466],{},[447,464,465],{},"303",[447,467,468],{},"Sending a visitor to another page after a form",[432,470,471,474],{},[447,472,473],{},"307",[447,475,476],{},"A temporary move that keeps the request's method, such as a POST",[432,478,479,482],{},[447,480,481],{},"308",[447,483,484],{},"A permanent move that keeps the request's method",[14,486,487],{},"Search engines treat a 301 or a 308 as the page's new address, and a 302 or a 307 as a short detour.",[71,489,491],{"id":490},"order","Order",[14,493,494,495,497,498,501,502,505],{},"Rules are checked from the top, and the first one that matches answers: the user rules first, then the ",[21,496,67],{}," rules, and both before your site's files. A rule for ",[21,499,500],{},"\u002Fpricing"," applies even when ",[21,503,504],{},"pricing.html"," exists.",[14,507,508,509,511,512,514],{},"A user rule for the same path as a ",[21,510,67],{}," rule overrides it, and the Redirects panel marks that ",[21,513,67],{}," rule as overridden.",[14,516,517,518,521],{},"Put specific rules above broad ones. In this file, ",[21,519,520],{},"\u002Fshop\u002Fsale"," never reaches line 2:",[271,523,526],{"className":524,"code":525,"language":276,"meta":277},[274],"\u002Fshop\u002F*      \u002Fstore\u002F:splat\n\u002Fshop\u002Fsale   \u002Fdeals\n",[21,527,525],{"__ignoreMap":277},[14,529,530,531,533],{},"A broad rule such as ",[21,532,363],{}," sends every page away. Check the rules in the site's Redirects panel after a deploy.",[71,535,537],{"id":536},"query-strings","Query strings",[14,539,540,541,136,544,207,547,550,551,554],{},"The visitor's query string goes along to the destination: with ",[21,542,543],{},"\u002Fold \u002Fnew",[21,545,546],{},"\u002Fold?utm_source=newsletter",[21,548,549],{},"\u002Fnew?utm_source=newsletter",". When the destination has its own query string, such as ",[21,552,553],{},"\u002Fnew?ref=old",", that one is used instead.",[14,556,557],{},"Redirects are never cached, so each visitor gets their own query string, and a rule that a deploy removes stops at once. A page the CDN has kept at a path that has just gained a rule can still be served for up to 5 minutes.",[71,559,561],{"id":560},"lines-that-dont-work","Lines that don't work",[14,563,564],{},"A line with a mistake is skipped, and the rest of the file applies, so a typo doesn't stop a deploy. The sites list shows how many lines a site's live deploy skipped, and the site's Redirects panel lists each one with the reason. A user rule with a mistake is never saved: the panel shows the mistake on the rule.",[14,566,567],{},"These aren't supported, and are skipped:",[40,569,570,573,576,579],{},[43,571,572],{},"rewrites with status 200, and 404 rules;",[43,574,575],{},"conditions, such as a country, a language or a cookie;",[43,577,578],{},"a full URL as the old path, or a query string in it;",[43,580,581],{},"a rule that sends a path to itself.",[71,583,585],{"id":584},"turn-off-a-deploys-_redirects","Turn off a deploy's _redirects",[14,587,588,589,591,592,595,596,171],{},"When a deployed ",[21,590,67],{}," sends visitors to the wrong place, turn off ",[46,593,594],{},"Apply the rules from _redirects"," in the site's Redirects panel. Within about 5 minutes, the site serves its pages again, and the user rules keep applying. The rules stay off until you turn them back on, or until the next deploy goes live with its own ",[21,597,67],{},[71,599,601],{"id":600},"limits","Limits",[14,603,604,605,607],{},"The same on every plan, for the ",[21,606,67],{}," file and for the user rules each:",[40,609,610,613,616,622],{},[43,611,612],{},"up to 1 MB, about 13,000 rules of a usual length;",[43,614,615],{},"up to 20,000 rules;",[43,617,618,619,621],{},"of those, up to 1,000 rules with a ",[21,620,345],{}," or a placeholder;",[43,623,624],{},"up to 1,000 characters a line.",[14,626,64,627,629],{},[21,628,67],{}," file over 1 MB applies no rules, and rules past the other limits are skipped. A change to the user rules that would pass a limit isn't saved, and says which limit.",[71,631,633],{"id":632},"from-webflow","From Webflow",[14,635,636,637,136,639,642,643,646,647,650,651,653],{},"Export your 301 redirects as a CSV from the Webflow site's settings, then import the file in the site's Redirects panel with ",[46,638,151],{},[46,640,641],{},"Webflow export",". Each redirect becomes a user rule with status 301. A trailing ",[21,644,645],{},"(.*)"," in the old path becomes a splat, and ",[21,648,649],{},"%1"," in the new one becomes ",[21,652,349],{},":",[426,655,656,666],{},[429,657,658],{},[432,659,660,663],{},[435,661,662],{},"In Webflow",[435,664,665],{},"As a rule",[442,667,668,683],{},[432,669,670,679],{},[447,671,672,675,676],{},[21,673,674],{},"\u002Fblog\u002F(.*)"," to ",[21,677,678],{},"\u002Fnews\u002F%1",[447,680,681],{},[21,682,353],{},[432,684,685,692],{},[447,686,687,675,689],{},[21,688,331],{},[21,690,691],{},"\u002Fabout",[447,693,694],{},[21,695,696],{},"\u002Fabout-us \u002Fabout",[14,698,699,700,702,703,705,706,709,710,712,713,717],{},"Other Webflow patterns, such as ",[21,701,645],{}," in the middle of a path, a capture other than ",[21,704,645],{},", or ",[21,707,708],{},"%2",", have no ",[21,711,67],{}," form. The import lists each one as an error, leaves it out, and imports the rest. Add those rules by hand, with a ",[26,714,716],{"href":715},"#paths","placeholder"," where one fits.",[14,719,720,721,723,724,726,727,729],{},"To keep the redirects with your site's files instead, write the same rules as lines of a ",[21,722,67],{}," file, or import them and then ",[46,725,131],{}," them as ",[21,728,67],{}," lines.",[71,731,233],{"id":732},"the-bare-domain",[14,734,735,736,739,740,743,744,747,748,751],{},"A site on the bare domain, such as ",[21,737,738],{},"example.com",", is served at ",[21,741,742],{},"www.example.com",". A visitor who opens ",[21,745,746],{},"example.com\u002Fold"," is first sent to ",[21,749,750],{},"www.example.com\u002Fold",", and the rule applies there. Both redirects keep the path and the query string.",{"title":277,"searchDepth":753,"depth":753,"links":754},2,[755,759,760,761,762,763,764,765,766,767,768,769],{"id":73,"depth":753,"text":74,"children":756},[757],{"id":123,"depth":758,"text":124},3,{"id":163,"depth":753,"text":164},{"id":258,"depth":753,"text":259},{"id":319,"depth":753,"text":320},{"id":423,"depth":753,"text":424},{"id":490,"depth":753,"text":491},{"id":536,"depth":753,"text":537},{"id":560,"depth":753,"text":561},{"id":584,"depth":753,"text":585},{"id":600,"depth":753,"text":601},{"id":632,"depth":753,"text":633},{"id":732,"depth":753,"text":233},"Send old URLs to new ones from the dashboard or a _redirects file in your site, or forward a whole domain, so links and search rankings keep working.","md","solar:routing-2-bold",{},null,"\u002Fdocs\u002Fgetting-started\u002Fredirects",{"title":5,"description":770},{"loc":775},"docs\u002F1.getting-started\u002F5.redirects","2026-11-12","q1jEi0iwLcKS4wQNLPZpedCy6J9RZRgWYHn_VbajvkE",[782],{"title":783,"path":784,"stem":785,"children":786,"page":936},"Docs","\u002Fdocs","docs",[787,814,826,864,919],{"title":788,"path":789,"stem":790,"children":791,"page":-1,"icon":793},"Getting Started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started\u002Findex",[792,794,798,802,806,809,810],{"title":788,"path":789,"stem":790,"icon":793},"solar:rocket-bold",{"title":795,"path":796,"stem":797},"Introduction","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F1.introduction",{"title":799,"path":800,"stem":801},"Quick Start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","docs\u002F1.getting-started\u002F2.quick-start",{"title":803,"path":804,"stem":805},"Sites","\u002Fdocs\u002Fgetting-started\u002Fsites","docs\u002F1.getting-started\u002F3.sites",{"title":807,"path":28,"stem":808},"Custom Domains","docs\u002F1.getting-started\u002F4.custom-domains",{"title":5,"path":775,"stem":778},{"title":811,"path":812,"stem":813},"Support","\u002Fdocs\u002Fgetting-started\u002Fsupport","docs\u002F1.getting-started\u002F6.support",{"title":815,"path":816,"stem":817,"children":818,"page":-1,"icon":820},"Integrations","\u002Fdocs\u002Fintegrations","docs\u002F2.integrations\u002Findex",[819,821],{"title":815,"path":816,"stem":817,"icon":820},"ph:usb-bold",{"title":822,"path":823,"stem":824,"icon":825},"n8n","\u002Fdocs\u002Fintegrations\u002Fn8n","docs\u002F2.integrations\u002F1.n8n","simple-icons:n8n",{"title":827,"path":828,"stem":829,"children":830,"page":-1,"icon":832},"MCP","\u002Fdocs\u002Fmcp","docs\u002F3.mcp\u002Findex",[831,833,837,841,845,848,852,856,860],{"title":827,"path":828,"stem":829,"icon":832},"solar:plug-circle-bold",{"title":834,"path":835,"stem":836},"Quick start","\u002Fdocs\u002Fmcp\u002Fquick-start","docs\u002F3.mcp\u002F1.quick-start",{"title":838,"path":839,"stem":840},"Clients","\u002Fdocs\u002Fmcp\u002Fclients","docs\u002F3.mcp\u002F2.clients",{"title":842,"path":843,"stem":844},"Authentication","\u002Fdocs\u002Fmcp\u002Fauthentication","docs\u002F3.mcp\u002F3.authentication",{"title":846,"path":57,"stem":847},"Tools","docs\u002F3.mcp\u002F4.tools",{"title":849,"path":850,"stem":851},"Recipes","\u002Fdocs\u002Fmcp\u002Frecipes","docs\u002F3.mcp\u002F5.recipes",{"title":853,"path":854,"stem":855},"Limits and errors","\u002Fdocs\u002Fmcp\u002Flimits-and-errors","docs\u002F3.mcp\u002F6.limits-and-errors",{"title":857,"path":858,"stem":859},"FAQ","\u002Fdocs\u002Fmcp\u002Ffaq","docs\u002F3.mcp\u002F7.faq",{"title":861,"path":862,"stem":863},"Network access","\u002Fdocs\u002Fmcp\u002Fnetwork-access","docs\u002F3.mcp\u002F8.network-access",{"title":865,"path":866,"stem":867,"children":868,"page":-1,"icon":870},"Site kit","\u002Fdocs\u002Fsite-kit","docs\u002F4.site-kit\u002Findex",[869,871,875,879,883,887,891,895,899,903,907,911,915],{"title":865,"path":866,"stem":867,"icon":870},"solar:layers-bold",{"title":872,"path":873,"stem":874},"Overview","\u002Fdocs\u002Fsite-kit\u002Foverview","docs\u002F4.site-kit\u002F01.overview",{"title":876,"path":877,"stem":878},"Start a site","\u002Fdocs\u002Fsite-kit\u002Fstart-a-site","docs\u002F4.site-kit\u002F02.start-a-site",{"title":880,"path":881,"stem":882},"Move a site from Webflow","\u002Fdocs\u002Fsite-kit\u002Fmove-from-webflow","docs\u002F4.site-kit\u002F03.move-from-webflow",{"title":884,"path":885,"stem":886},"Content","\u002Fdocs\u002Fsite-kit\u002Fcontent","docs\u002F4.site-kit\u002F04.content",{"title":888,"path":889,"stem":890},"Design","\u002Fdocs\u002Fsite-kit\u002Fdesign","docs\u002F4.site-kit\u002F05.design",{"title":892,"path":893,"stem":894},"Languages","\u002Fdocs\u002Fsite-kit\u002Flanguages","docs\u002F4.site-kit\u002F06.languages",{"title":896,"path":897,"stem":898},"Deploy with Hostsmith","\u002Fdocs\u002Fsite-kit\u002Fdeploy","docs\u002F4.site-kit\u002F07.deploy",{"title":900,"path":901,"stem":902},"Keep old URLs","\u002Fdocs\u002Fsite-kit\u002Fold-urls","docs\u002F4.site-kit\u002F08.old-urls",{"title":904,"path":905,"stem":906},"Work with an AI agent","\u002Fdocs\u002Fsite-kit\u002Fai-agents","docs\u002F4.site-kit\u002F09.ai-agents",{"title":908,"path":909,"stem":910},"Kit updates","\u002Fdocs\u002Fsite-kit\u002Fupdates","docs\u002F4.site-kit\u002F10.updates",{"title":912,"path":913,"stem":914},"Existing Astro sites","\u002Fdocs\u002Fsite-kit\u002Fexisting-astro-sites","docs\u002F4.site-kit\u002F11.existing-astro-sites",{"title":916,"path":917,"stem":918},"External CMS","\u002Fdocs\u002Fsite-kit\u002Fexternal-cms","docs\u002F4.site-kit\u002F12.external-cms",{"title":920,"path":52,"stem":921,"children":922,"page":-1,"icon":924},"Developers","docs\u002F5.developers\u002Findex",[923,925,928,932],{"title":920,"path":52,"stem":921,"icon":924},"solar:code-bold",{"title":842,"path":926,"stem":927},"\u002Fdocs\u002Fdevelopers\u002Fauthentication","docs\u002F5.developers\u002F1.authentication",{"title":929,"path":930,"stem":931},"API Explorer","\u002Fdocs\u002Fdevelopers\u002Fapi-explorer","docs\u002F5.developers\u002F2.api-explorer",{"title":933,"path":934,"stem":935},"Node.js SDK","\u002Fdocs\u002Fdevelopers\u002Fsdk","docs\u002F5.developers\u002F3.sdk",false,[938,939],{"title":807,"path":28,"stem":808,"children":-1},{"title":811,"path":812,"stem":813,"children":-1},1795363511269]