{"id":7058,"date":"2023-12-08T07:36:22","date_gmt":"2023-12-08T07:36:22","guid":{"rendered":"https:\/\/musilda.cz\/?p=7058"},"modified":"2023-12-08T07:36:22","modified_gmt":"2023-12-08T07:36:22","slug":"http-stavove-kody-ve-wordpressu","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/http-stavove-kody-ve-wordpressu\/","title":{"rendered":"HTTP stavov\u00e9 k\u00f3dy ve WordPressu"},"content":{"rendered":"\n
Stavov\u00fd k\u00f3d str\u00e1nky je informace, kterou obdr\u017e\u00edte od serveru, kdy\u017e si na\u010dtete webovou str\u00e1nku v prohl\u00ed\u017ee\u010di. V\u011bd\u011bt co kter\u00fd k\u00f3d znamen\u00e1, je d\u016fle\u017eit\u00e9 pro identifikaci p\u0159\u00edpadn\u00e9ho probl\u00e9mu na stran\u011b webu. <\/p>\n\n\n\n
N\u011bkter\u00e9 k\u00f3dy ozna\u010duj\u00ed p\u0159esm\u011brov\u00e1n\u00ed, jin\u00e9 zase chybu na webu. Jejich \u0161patn\u00e9 pou\u017eit\u00ed v p\u0159\u00edpad\u011b p\u0159esm\u011brov\u00e1n\u00ed m\u016f\u017ee m\u00edt velmi negativn\u00ed vliv na SEO. U stavov\u00fdch k\u00f3d\u016f 404, m\u016f\u017ee jejich n\u00e1hl\u00fd a zv\u00fd\u0161en\u00fd v\u00fdskyt v Search Console, ukazovat na n\u011bjak\u00fd syst\u00e9mov\u00fd probl\u00e9m (hromadn\u00e1 zm\u011bna url a podobn\u011b).<\/p>\n\n\n\n
Je tedy d\u016fle\u017eit\u00e9 se v stavov\u00fdch k\u00f3dech orientovat.<\/p>\n\n\n\n
HTTP stavov\u00e9 k\u00f3dy jsou t\u0159\u00ed\u010d\u00edseln\u00e9 odpov\u011bdi, kter\u00e9 server vrac\u00ed zp\u011bt klientovi(prohl\u00ed\u017ee\u010d, nebo vyhled\u00e1va\u010d). Stavov\u00e9 k\u00f3dy se rozd\u011bluj\u00ed do p\u011bt z\u00e1kladn\u00edch t\u0159\u00edd, z nich\u017e ka\u017ed\u00e1 obsahuje n\u011bkolik variant(ka\u017ed\u00e1 varianta sd\u011bluje odli\u0161nou zpr\u00e1vu).<\/p>\n\n\n\n
HTTP stavov\u00e9 k\u00f3dy jsou t\u0159\u00ed\u010d\u00edseln\u00e9 odpov\u011bdi, kter\u00e9 server vrac\u00ed zp\u011bt klientovi(prohl\u00ed\u017ee\u010d, nebo vyhled\u00e1va\u010d). Stavov\u00e9 k\u00f3dy se rozd\u011bluj\u00ed do p\u011bt z\u00e1kladn\u00edch t\u0159\u00edd, z nich\u017e ka\u017ed\u00e1 obsahuje n\u011bkolik variant(ka\u017ed\u00e1 varianta sd\u011bluje odli\u0161nou zpr\u00e1vu).<\/p>\n\n\n\n
V\u017edy, kdy\u017e otev\u0159eme n\u011bjakou str\u00e1nku v prohl\u00ed\u017ee\u010di, vytvo\u0159\u00edme t\u00edm a\u017e des\u00edtky po\u017eadavk\u016f na serveru, kter\u00e9 sh\u00e1n\u011bj\u00ed ve\u0161ker\u00e9 informace, kter\u00e9 jsou pot\u0159ebn\u00e9 pro spr\u00e1vn\u00e9 zobrazen\u00ed str\u00e1nky. V\u0161e prob\u00edh\u00e1 velmi rychle bez na\u0161eho pov\u0161imnut\u00ed. Cel\u00e1 tato rychl\u00e1 akce je umo\u017en\u011bna p\u0159edev\u0161\u00edm d\u00edky zmi\u0148ovan\u00fdm HTTP stavov\u00fdm k\u00f3d\u016fm.<\/p>\n\n\n\n
HTTP, neboli „Hypertext Transfer Protocol“ je protokol, kter\u00fd se pou\u017e\u00edv\u00e1 pro komunikaci a v\u00fdm\u011bnu dat mezi klientem a serverem. Stavov\u00e9 k\u00f3dy jsou sou\u010d\u00e1st\u00ed tohoto komunika\u010dn\u00edho procesu.<\/p>\n\n\n\n
„Timeouty“ jsou v podstat\u011b sign\u00e1lem, \u017ee komunikace mezi klientem a serverem byla p\u0159eru\u0161ena kv\u016fli pomal\u00e9, nebo \u017e\u00e1dn\u00e9 odezv\u011b ze strany serveru, kdy prohl\u00ed\u017ee\u010d po stanoven\u00e9m \u010dasov\u00e9m limitu ukon\u010d\u00ed pokus o spojen\u00ed. Timeouty nebo chyby spojen\u00ed jsou nep\u0159\u00edmo spojen\u00e9 s t\u0159\u00eddami HTTP stavov\u00fdch k\u00f3d\u016f a nejsou odpov\u011bd\u00ed serveru. Pro lep\u0161\u00ed pochopen\u00ed si uvedeme p\u00e1r p\u0159\u00edklad\u016f:<\/p>\n\n\n\n
To, \u017ee byl dosa\u017een server, kter\u00fd by byl schopen komunikovat se d\u00e1 zjistit tak, \u017ee na str\u00e1nce dostaneme HTTP stavov\u00fd k\u00f3d.<\/p>\n\n\n\n
Jak ji\u017e mnoz\u00ed tu\u0161\u00ed, tak pro spr\u00e1vn\u00e9 SEO je pot\u0159eba, aby se na n\u00e1\u0161 web dostali nejen u\u017eivatel\u00e9, ale tak\u00e9 web crawle\u0159i(automatizovan\u00e9 programy pou\u017e\u00edvan\u00e9 pro proch\u00e1zen\u00ed internetu a sb\u011br informac\u00ed o webov\u00fdch str\u00e1nk\u00e1ch), kte\u0159\u00ed v r\u00e1mci SEO hraj\u00ed kl\u00ed\u010dovou roli. <\/p>\n\n\n\n
Na na\u0161em webu si vy\u017eaduj\u00ed obsah, kter\u00fd by se m\u011bl vracet se stavov\u00fdm k\u00f3dem 200 – OK<\/strong>, V t\u011bch hor\u0161\u00edch p\u0159\u00edpadech se m\u016f\u017ee po\u017eadovan\u00fd obsah vr\u00e1tit s k\u00f3dy 5xx<\/strong>, a 4xx<\/strong>, co\u017e je \u0161patn\u011b. Dal\u0161\u00edm k\u00f3dem m\u016f\u017ee b\u00fdt 3xx<\/strong>, kter\u00e9mu bychom se m\u011bli tak\u00e9 vyh\u00fdbat, co to jenom jde. Stavov\u00fd k\u00f3d 3xx <\/strong>znamen\u00e1 p\u0159esm\u011brov\u00e1n\u00ed na jinou str\u00e1nku, co\u017e m\u016f\u017ee zv\u00fd\u0161it dobu jej\u00edho na\u010d\u00edt\u00e1n\u00ed a negativn\u011b tak ovlivnit SEO.<\/p>\n\n\n\n Webov\u00fd crawle\u0159i a weby mezi sebou komunikuj\u00ed pomoc\u00ed HTTP, a my tak bez dostate\u010dn\u00fdch znalost\u00ed m\u016f\u017eeme jen t\u011b\u017eko porozum\u011bt slo\u017eit\u00e9mu komplexu SEO.<\/p>\n\n\n\n HTTP odpov\u011bdi odeslan\u00e9 webov\u00fdmi servery obvykle obsahuj\u00ed dv\u011b \u010d\u00e1sti: hlavi\u010dky a t\u011blo zpr\u00e1vy.<\/p>\n\n\n\n Hlavi\u010dk<\/strong>y zpr\u00e1vy<\/strong><\/p>\n\n\n\n T\u011blo zpr\u00e1vy<\/strong><\/p>\n\n\n\n Pod\u00edvejme se na zjednodu\u0161en\u00fd p\u0159\u00edklad toho, co v\u00e1\u0161 prohl\u00ed\u017ee\u010d ud\u011blal, kdy\u017e jste po\u017e\u00e1dali o zobrazen\u00ed t\u00e9to str\u00e1nky:<\/p>\n\n\n\n GET \/seo-navod-na-http-stavove-kody\/ HTTP\/2<\/strong><\/p>\n\n\n\n To se rozkl\u00e1d\u00e1 takto:<\/p>\n\n\n\n A zde je hlavi\u010dka HTTP odpov\u011bdi, kterou n\u00e1\u0161 server poslal zp\u011bt:<\/p>\n\n\n\n HTTP\/2 200 OK<\/p>\n\n\n\n Nejb\u011b\u017en\u011bj\u0161\u00edmi HTTP stavov\u00fdmi k\u00f3dy, se kter\u00fdmi se setk\u00e1te ve sv\u011bt\u011b SEO jsou:<\/p>\n\n\n\n Stavov\u00e9 k\u00f3dy HTTP m\u016f\u017eeme zobrazit p\u0159\u00edmo v prohl\u00ed\u017ee\u010di pomoc\u00ed vestav\u011bn\u00fdch n\u00e1stroj\u016f, roz\u0161\u00ed\u0159en\u00ed prohl\u00ed\u017ee\u010de nebo pomoc\u00ed n\u00e1stroje pro kontrolu URL ve slu\u017eb\u011b Google Search Console<\/a>.<\/p>\n\n\n\n Jak propojit WordPress web s Google Search konzol\u00ed se dozv\u00edte zde<\/a>.<\/p>\n\n\n\n Tento typ kontrol je prov\u00e1d\u011bn zvl\u00e1\u0161\u0165 na ka\u017ed\u00e9 str\u00e1nce, proto je postup pomal\u00fd a neefektivn\u00ed(plat\u00ed v p\u0159\u00edpad\u011b, \u017ee chceme zkontrolovat velk\u00e9 mno\u017estv\u00ed URL adres). <\/p>\n\n\n\n Kontrola stavov\u00e9ho k\u00f3du je ve v\u0161ech prohl\u00ed\u017ee\u010d\u00edch t\u00e9m\u011b\u0159 identick\u00e1. Ka\u017ed\u00fd z t\u011bchto popul\u00e1rn\u00edch prohl\u00ed\u017ee\u010d\u016f nab\u00edz\u00ed sv\u016fj vlastn\u00ed vestav\u011bn\u00fd n\u00e1stroj.<\/p>\n\n\n\n Pokud n\u00e1m zm\u00edn\u011bn\u00e1 \u0159e\u0161en\u00ed nesta\u010dila, nab\u00edz\u00ed se \u00faprava prohl\u00ed\u017ee\u010de pomoc\u00ed r\u016fzn\u00fdch dopl\u0148k\u016f. Konkr\u00e9tn\u011b se zam\u011b\u0159\u00edme na jedno z nejpopul\u00e1rn\u011bj\u0161\u00edch roz\u0161\u00ed\u0159en\u00ed v t\u00e9to oblasti pro Google Chrome. Jedn\u00e1 se o bezplatn\u00fd dopln\u011bk „Redirect Path<\/a>„, kter\u00fd se zam\u011b\u0159uje na kontrolu HTTP hlavi\u010dky a p\u0159esm\u011brov\u00e1n\u00ed pro SEO. <\/p>\n\n\n\n Mezi dal\u0161\u00ed funkce pat\u0159\u00ed ozna\u010dov\u00e1n\u00ed 301, 302, 404 a 500 HTTP stavov\u00fdch k\u00f3d\u016f a mo\u017enost zobrazen\u00ed p\u0159esm\u011brov\u00e1n\u00ed na stran\u011b klienta, jako jsou Meta a JavaScriptov\u00e1 p\u0159esm\u011brov\u00e1n\u00ed, upozor\u0148uj\u00edc\u00ed na mo\u017en\u00e9 probl\u00e9my, kter\u00e9 by jinak nemusely b\u00fdt hned vid\u011bt.<\/p>\n\n\n\n Dal\u0161\u00edm mo\u017en\u00fdm zp\u016fsobem je Google Search Console, kter\u00e1 nab\u00edz\u00ed n\u00e1stroj(„URL Inspection Tool“), do kter\u00e9ho vlo\u017e\u00edme URL adresu webu, a konzole pot\u00e9 vyhodnot\u00ed HTTP stavov\u00fd k\u00f3d.<\/p>\n\n\n\n \u010casem se mohou na serveru vyskytnout probl\u00e9my(nap\u0159. p\u0159i hromadn\u00e9 manipulaci s obsahem), kter\u00e9 zap\u0159\u00ed\u010din\u00ed hned n\u011bkolik zm\u011bn v HTTP stavov\u00fdch k\u00f3dech. V tomto p\u0159\u00edpad\u011b by kontrola na \u00farovni jednotliv\u00fdch str\u00e1nek nesta\u010dila.<\/p>\n\n\n\n \u0158e\u0161en\u00edm je monitorov\u00e1n\u00ed HTTP stavov\u00fdch k\u00f3d\u016f URL adres pomoc\u00ed n\u00e1stroj\u016f. Uvedeme zde nap\u0159. n\u00e1stroj „ContentKing<\/a>„, kter\u00fd automaticky upozor\u0148uje na vznikl\u00e9 chyby, nebo p\u0159esm\u011brov\u00e1n\u00ed. V\u00fdhodou je aktualizace stavu na\u0161ich str\u00e1nek v re\u00e1ln\u00e9m \u010dase.<\/p>\n\n\n\n Existuje p\u011bt t\u0159\u00edd HTTP odpov\u011bd\u00ed stavov\u00fdch k\u00f3d\u016f:<\/p>\n\n\n\n V\u0161echny HTTP stavov\u00e9 k\u00f3dy 1xx jsou pouze pro informa\u010dn\u00ed \u00fa\u010dely. Ozna\u010duj\u00ed, \u017ee \u017e\u00e1dost byla p\u0159ijata a spr\u00e1vn\u011b p\u0159evzata, zat\u00edm v\u0161ak nebyla zpracov\u00e1na. <\/p>\n\n\n\n HTTP 2xx stavov\u00e9 k\u00f3dy zna\u010d\u00ed, \u017ee byl po\u017eadavek \u00fasp\u011b\u0161n\u00fd, a v\u0161e pokra\u010duje podle pl\u00e1nu.<\/p>\n\n\n\n Znamenaj\u00ed, \u017ee je pot\u0159eba prov\u00e9zt dal\u0161\u00ed akce. Po\u017eadavek sice byl p\u0159ijat, ale akce prozat\u00edm nem\u016f\u017ee b\u00fdt spln\u011bna. <\/p>\n\n\n\n Pokud klient dostane tento stavov\u00fd k\u00f3d, mus\u00ed vytvo\u0159it nov\u00fd po\u017eadavek na p\u0159esm\u011brovanou lokaci serveru. Tato sekce se bude zab\u00fdvat v\u0161emi zm\u011bnami v p\u0159esm\u011brov\u00e1n\u00ed.<\/p>\n\n\n\n Z pohledu SEO si zde uk\u00e1\u017eeme ty nejb\u011b\u017en\u011bj\u0161\u00ed HTTP stavov\u00e9 k\u00f3dy v t\u00e9to oblasti:<\/p>\n\n\n\n Ozna\u010duje, \u017ee zdroj byl trvale p\u0159esunut na jin\u00e9 m\u00edsto. \u017d\u00e1dost a ve\u0161ker\u00e9 budouc\u00ed \u017e\u00e1dosti mus\u00ed b\u00fdt p\u0159esm\u011brov\u00e1ny na jinou URL adresu. <\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 301:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 301:<\/p>\n\n\n\n Ozna\u010duje, \u017ee zdroj byl do\u010dasn\u011b p\u0159esunut na jin\u00e9 m\u00edsto. Tento druh p\u0159esm\u011brov\u00e1n\u00ed se \u010dasto vyu\u017e\u00edv\u00e1 nap\u0159\u00edklad u str\u00e1nek, kde prob\u00edh\u00e1 \u00fadr\u017eba, kter\u00e9 jsou moment\u00e1ln\u011b neaktivn\u00ed, obsahuj\u00ed sez\u00f3nn\u00ed prodeje a podobn\u011b.<\/p>\n\n\n\n Po ur\u010dit\u00e9 dob\u011b mohou b\u00fdt 302 p\u0159esm\u011brov\u00e1n\u00ed vyhled\u00e1va\u010di vzaty jako 301 p\u0159esm\u011brov\u00e1n\u00ed(kdy\u017e je 302 p\u0159esm\u011brov\u00e1n\u00ed dlouhodob\u011b pou\u017e\u00edv\u00e1no, je ch\u00e1p\u00e1no jako trval\u00e9)! Nap\u0159. u WordPressu. lze pomoc\u00ed k\u00f3du zvolit dobu, po kterou bude n\u00e1hradn\u00ed adresa platn\u00e1.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 302:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 302:<\/p>\n\n\n\n Pou\u017e\u00edv\u00e1 se k ozna\u010den\u00ed situace, kdy server p\u0159esm\u011brov\u00e1v\u00e1 po\u017eadovanou URL adresu na jinou. Obvykle se pou\u017e\u00edv\u00e1 v situaci, kdy je nutn\u00e9 prov\u00e9st dal\u0161\u00ed krok ur\u010dit\u00e9 \u017e\u00e1dosti(nap\u0159. odes\u00edl\u00e1n\u00ed formul\u00e1\u0159\u016f). To se hod\u00ed k zabr\u00e1n\u011bn\u00ed u\u017eivatel\u016fm v n\u00e1hodn\u00e9m op\u011btovn\u00e9m odesl\u00e1n\u00ed formul\u00e1\u0159\u016f p\u0159i pou\u017eit\u00ed tla\u010d\u00edtka „zp\u011bt“ v jejich prohl\u00ed\u017ee\u010di.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 303:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 303:<\/p>\n\n\n\n Ozna\u010duje, \u017ee po\u017eadovan\u00fd zdroj nebyl od posledn\u00edho dotazu zm\u011bn\u011bn, a proto nebude vr\u00e1cen klientovi. Nam\u00edsto toho by se m\u011bla pou\u017e\u00edt ulo\u017een\u00e1 verze.<\/p>\n\n\n\n Pokud jsme nap\u0159. n\u011bjakou str\u00e1nku nav\u0161t\u00edvili 23. z\u00e1\u0159\u00ed, a 25. z\u00e1\u0159\u00ed str\u00e1nku znovu nav\u0161t\u00edv\u00edme, tak se serveru zept\u00e1me, zda se od posledn\u00edho na\u010dten\u00ed str\u00e1nky n\u011bco zm\u011bnilo. V p\u0159\u00edpad\u011b, \u017ee je str\u00e1nka stejn\u00e1, pou\u017e\u00edt by se m\u011bla naposledy ulo\u017een\u00e1 verze.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 304:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 304:<\/p>\n\n\n\n Je t\u00e9m\u011b\u0159 identick\u00fd se stavov\u00fdm k\u00f3dem 302(Found \/ Moved temporarily). Rozd\u00edl je v tom, \u017ee p\u0159esm\u011brov\u00e1n\u00ed 302 nezaru\u010duje, \u017ee nedojde ke zm\u011bn\u011b pou\u017eit\u00e9 HTTP metody(GET, POST\u2026), ale p\u0159esm\u011brov\u00e1n\u00ed 307 n\u00e1m toto zaru\u010dit dok\u00e1\u017ee. V podstat\u011b se 307 pou\u017e\u00edv\u00e1, kdy\u017e je d\u016fle\u017eit\u00e9 zachovat p\u016fvodn\u00ed metodu HTTP \u017e\u00e1dosti p\u0159i n\u00e1sledn\u00e9m p\u0159esm\u011brov\u00e1n\u00ed.<\/p>\n\n\n\n P\u0159\u00edklad: Kdy\u017e se prohl\u00ed\u017ee\u010d sna\u017e\u00ed dostat na ur\u010ditou webovou str\u00e1nku, kterou chce otev\u0159\u00edt p\u0159es HTTP (co\u017e je star\u0161\u00ed, m\u00e9n\u011b zabezpe\u010den\u00fd zp\u016fsob), tak mu k\u00f3d 307 sd\u011bl\u00ed, \u017ee je lep\u0161\u00ed pou\u017e\u00edt HTTPS (co\u017e je modern\u011bj\u0161\u00ed a bezpe\u010dn\u011bj\u0161\u00ed zp\u016fsob). To znamen\u00e1, \u017ee prohl\u00ed\u017ee\u010d nejde tou p\u016fvodn\u00ed cestou, ale m\u00edsto toho se p\u0159esm\u011bruje po nov\u00e9, bezpe\u010dn\u00e9 cest\u011b. T\u00edm se zamez\u00ed nebezpe\u010dn\u00fdm situac\u00edm a chr\u00e1n\u00ed u\u017eivatele.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 307:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 307:<\/p>\n\n\n\n Slou\u017e\u00ed pro t\u00e9m\u011b\u0159 stejn\u00e9 \u00fa\u010dely, jako p\u0159esm\u011brov\u00e1n\u00ed 301. Rozd\u00edl je v tom, \u017ee 308 neumo\u017e\u0148uje zm\u011bnu metody po\u017eadavku z POST na GET.<\/p>\n\n\n\n P\u0159\u00edklad: Tento k\u00f3d by dok\u00e1zal zaru\u010dit, \u017ee i p\u0159i pokusu o p\u0159\u00edstup p\u0159es HTTP (nezabezpe\u010den\u00e9 spojen\u00ed) budou u\u017eivatel\u00e9 automaticky p\u0159esm\u011brov\u00e1ni na HTTPS (zabezpe\u010den\u00e9 spojen\u00ed), a to se zachov\u00e1n\u00edm p\u016fvodn\u00ed metody po\u017eadavku, tedy nap\u0159\u00edklad i p\u0159i POST po\u017eadavku.<\/p>\n\n\n\n Vyzna\u010duj\u00ed chyby, kter\u00e9 se objevily na stran\u011b klienta. D\u016fvody t\u011bchto chyb mohou b\u00fdt nedostate\u010dn\u00e1 opr\u00e1vn\u011bn\u00ed pro \u017e\u00e1dost na str\u00e1nku, po\u017eadavek na neexistuj\u00edc\u00ed str\u00e1nku nebo nadm\u011brn\u00fd po\u010det po\u017eadavk\u016f.<\/p>\n\n\n\n V t\u00e9to \u010d\u00e1sti se zam\u011b\u0159\u00edme na HTTP stavov\u00e9 k\u00f3dy, kter\u00e9 maj\u00ed zvl\u00e1\u0161tn\u00ed v\u00fdznam v oblasti SEO:<\/p>\n\n\n\n Stavov\u00fd k\u00f3d 401 je chyba, kter\u00e1 popisuje, \u017ee HTTP autentizace selhala. Po\u017eadovan\u00e1 str\u00e1nka vy\u017eaduje bu\u010f kombinaci u\u017eivatelsk\u00e9ho jm\u00e9na a hesla, nebo nen\u00ed povolen p\u0159\u00edstup na z\u00e1klad\u011b IP adresy.<\/p>\n\n\n\n K\u00f3d 401 se d\u00e1 obvykle vid\u011bt, kdy\u017e se crawle\u0159i sna\u017e\u00ed p\u0159istupovat do testovac\u00edho prost\u0159ed\u00ed, kde je nastavena HTTP autentizace, V jin\u00fdch p\u0159\u00edpadech by mohli vyhled\u00e1va\u010de indexovat na\u0161e testovac\u00ed prost\u0159ed\u00ed, ke kter\u00e9mu by se pak mohl dostat t\u00e9m\u011b\u0159 kdokoliv.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 401:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 401:<\/p>\n\n\n\n Jak u\u017e n\u00e1zev napov\u00edd\u00e1, u\u017eivatel m\u00e1 vstup na str\u00e1nku zak\u00e1zan\u00fd. V\u011bt\u0161inou je i zdroj probl\u00e9mu na jeho stran\u011b. Chybov\u00fd k\u00f3d sice zna\u010d\u00ed, \u017ee hledan\u00e1 URL adresa existuje, ale \u017e\u00e1dost o p\u0159\u00edstup ze strany klienta ji\u017e nem\u016f\u017ee b\u00fdt provedena(nap\u0159. \u017ee klient poskytuje nespr\u00e1vn\u00e9 p\u0159ihla\u0161ovac\u00ed \u00fadaje.)<\/p>\n\n\n\n P\u0159esto je vhodn\u00e9 m\u00edt na pam\u011bti, \u017ee stavov\u00e9 k\u00f3dy HTTP 401 a 403 jsou pou\u017e\u00edv\u00e1ny v odli\u0161n\u00fdch situac\u00edch!<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 403:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 403:<\/p>\n\n\n\n Stavov\u00fd k\u00f3d 404 znamen\u00e1, \u017ee po\u017eadovan\u00fd zdroj nemohl b\u00fdt nalezen. To v\u0161ak nemus\u00ed nutn\u011b znamenat, \u017ee byl zdroj nalezen ji\u017e d\u0159\u00edve, jako tomu je u HTTP stavov\u00e9ho k\u00f3du 410. Zjednodu\u0161en\u011b to znamen\u00e1, \u017ee to co hled\u00e1me(ji\u017e) nen\u00ed k dispozici.<\/p>\n\n\n\n Jedn\u00e1 se o jeden z nejzn\u00e1m\u011bj\u0161\u00edch a nej\u010dast\u011bj\u0161\u00edch chybov\u00fdch k\u00f3d\u016f, kter\u00fd je zn\u00e1m\u00fd i mezi b\u011b\u017en\u00fdmi u\u017eivateli. Probl\u00e9m m\u016f\u017ee vzniknout nap\u0159. v p\u0159\u00edpad\u011b, \u017ee na webu odstran\u00edme n\u011bjakou str\u00e1nku, kter\u00e1 je ji\u017e prolinkovan\u00e1 na jin\u00fdch webech. U\u017eivatel je tak po rozkliknut\u00ed ji\u017e neexistuj\u00edc\u00ed str\u00e1nky odk\u00e1z\u00e1n na chybu 404.<\/p>\n\n\n\n Z pohledu indexace neb\u00fdvaj\u00ed URL adresy s chybou 404 vy\u0159azeny ihned, ale d\u011bje se tak a\u017e po opakoven\u00e9m testov\u00e1n\u00ed, kdy ji\u017e nem\u00e1 cenu tuto URL adresu nad\u00e1le indexovat. Pokud tedy uvid\u00edme v\u00fdskyt t\u00e9to chyby na na\u0161em webu, m\u011bli bychom co nejd\u0159\u00edve jednat! Pokud se setk\u00e1me s touto chybou ve WordPressu, ur\u010dit\u011b by p\u0159i\u0161el vhod tento n\u00e1vod: „Jak opravit chybu 404 ve WordPressu<\/a>„.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 404:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 404:<\/p>\n\n\n\n Stavov\u00fd k\u00f3d signalizuje, \u017ee po\u017eadovan\u00e1 URL adresa byla trvale odstran\u011bna. To znamen\u00e1, \u017ee URL adresa existovala d\u0159\u00edve, ale byla explicitn\u011b odstran\u011bna, a ji\u017e nebude dostupn\u00e1.<\/p>\n\n\n\n Z pohledu SEO tento stavov\u00fd k\u00f3d poskytuje neskute\u010dn\u00e9 v\u00fdhody, proto\u017ee kdy\u017e je vr\u00e1cen stavov\u00fd k\u00f3d 410, vyhled\u00e1va\u010de rychle odstran\u00ed URL adresu ze sv\u00e9ho indexu. To z n\u011bj \u010din\u00ed mocn\u00fd n\u00e1stroj pro v\u0161echny SEO specialisty.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 410<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 410:<\/p>\n\n\n\n Stavov\u00fd k\u00f3d HTTP 418 je tak trochu vtipem a nejedn\u00e1 se tak o skute\u010dn\u00fd stavov\u00fd k\u00f3d, kter\u00fd by d\u011blal cokoliv konkr\u00e9tn\u00edho. Dne 1. dubna 1998 byl definov\u00e1n jako komunika\u010dn\u00ed protokol pro ovl\u00e1d\u00e1n\u00ed, monitorov\u00e1n\u00ed a diagnostiku k\u00e1vovar\u016f.<\/p>\n\n\n\n Zna\u010d\u00ed, \u017ee klient provedl p\u0159\u00edli\u0161 mnoho po\u017eadavk\u016f na serveru b\u011bhem ur\u010dit\u00e9ho \u010dasov\u00e9ho intervalu.<\/p>\n\n\n\n K\u00f3d lze vn\u00edmat pouze jako do\u010dasnou verzi stavov\u00e9ho HTTP k\u00f3du 403. Pokud se zobraz\u00ed chyba 429 a po\u017eadavky budou nad\u00e1le p\u0159ib\u00fdvat, server m\u016f\u017ee odpov\u011bd\u011bt stavov\u00fdm k\u00f3dem HTTP 403.<\/p>\n\n\n\n Pokud server opakovan\u011b vrac\u00ed k\u00f3d 429, m\u016f\u017ee Google odstranit obsah, pro kter\u00fd tyto k\u00f3dy obdr\u017eel. M\u011bli bychom se tedy ujistit, jak stabiln\u00ed je n\u00e1\u0161 webhosting, a jestli vrac\u00ed v\u017edy spr\u00e1vn\u00e9 stavov\u00e9 k\u00f3dy pro specifick\u00e9 \u00fakoly.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 429:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 429:<\/p>\n\n\n\n Jedn\u00e1 se o neofici\u00e1ln\u00ed stavov\u00fd k\u00f3d, kter\u00fd by se nem\u011bl pou\u017e\u00edvat.<\/p>\n\n\n\n S t\u00edmto k\u00f3dem se m\u016f\u017eeme setkat nap\u0159. v p\u0159\u00edpad\u011b, \u017ee pro n\u00e1\u0161 e-shop pou\u017e\u00edv\u00e1me Shopify(platforma pro e-commerce). Shopify zam\u00edchal pou\u017eit\u00ed stavov\u00fdch k\u00f3d\u016f a m\u00edsto HTTP stavov\u00e9ho k\u00f3du 429 tak vrac\u00ed k\u00f3d 430.<\/p>\n\n\n\n Pokud tedy na Shopify obdr\u017e\u00edme chybu 430, znamen\u00e1 to, \u017ee po\u017eadujeme p\u0159\u00edli\u0161 mnoho URL adres v ur\u010dit\u00e9m \u010dasov\u00e9m intervalu.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 430:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 430:<\/p>\n\n\n\n Chybov\u00fd k\u00f3d 451 zna\u010d\u00ed, \u017ee po\u017eadovan\u00e1 URL adresa nen\u00ed dostupn\u00e1 z n\u011bkter\u00fdch pr\u00e1vn\u00edch d\u016fvod\u016f. M\u016f\u017ee se tak st\u00e1t nap\u0159. v p\u0159\u00edpad\u011b, \u017ee n\u00e1m bylo na\u0159\u00edzeno odstranit n\u011bkterou str\u00e1nku.<\/p>\n\n\n\n Poskytovatel\u00e9 internetov\u00e9ho p\u0159ipojen\u00ed (ISP) mohou tak\u00e9 zasahovat a vracet stavov\u00fd k\u00f3d 451 nap\u0159. z d\u016fvodu, kdy\u017e jsou po\u017eadov\u00e1ny neleg\u00e1ln\u00ed torrentov\u00e9 str\u00e1nky. <\/p>\n\n\n\n Klient k chyb\u011b v\u011bt\u0161inou obdr\u017e\u00ed i podrobn\u011bj\u0161\u00ed informace, kter\u00e9 vysv\u011btluj\u00ed, z jak\u00fdch d\u016fvod\u016f je po\u017eadovan\u00fd zdroj nedostupn\u00fd.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 451:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 451:<\/p>\n\n\n\n Chybov\u00e9 k\u00f3dy 5xx jsou vr\u00e1ceny v p\u0159\u00edpad\u011b, kdy klienti po\u0161lou platn\u00e9 po\u017eadavky, ale server je z n\u011bjak\u00e9ho d\u016fvodu nedok\u00e1\u017ee dokon\u010dit. Webov\u00e1 str\u00e1nka m\u016f\u017ee b\u00fdt p\u0159\u00edli\u0161 vyt\u00ed\u017een\u00e1 nebo do\u010dasn\u011b nedostupn\u00e1 kv\u016fli \u00fadr\u017eb\u011b.<\/p>\n\n\n\n Pokud vyhled\u00e1va\u010de opakovan\u011b dost\u00e1vaj\u00ed chyby 5xx(nebo 429 chyby) p\u0159i proch\u00e1zen\u00ed webov\u00fdch str\u00e1nek, mohou podniknout n\u011bkolik krok\u016f, kter\u00e9 z pohledu SEO nejsou p\u0159\u00edli\u0161 v\u00fdhodn\u00e9:<\/p>\n\n\n\n V \u010dl\u00e1nku si projdeme n\u00e1sleduj\u00edc\u00ed stavov\u00e9 k\u00f3dy:<\/p>\n\n\n\n K\u00f3d znamen\u00e1, \u017ee server m\u011bl probl\u00e9my se zpracov\u00e1n\u00edm po\u017eadavku a nen\u00ed schopen konkr\u00e9tn\u011b uv\u00e9st, co se nezda\u0159ilo. Z toho d\u016fvodu je zdroj probl\u00e9mu velmi t\u011b\u017ek\u00e9 diagnostikovat.<\/p>\n\n\n\n Pokud pro sv\u016fj web pou\u017e\u00edv\u00e1te WordPress, a m\u00e1te probl\u00e9m s chybovou hl\u00e1\u0161kou 500, m\u016f\u017eete se obr\u00e1tit na n\u011bkoho jin\u00e9ho(webov\u00fd hosting, webmaster…), nebo se pokusit probl\u00e9m vy\u0159e\u0161it sami. K tomu dopom\u016f\u017ee \u010dl\u00e1nek „Jak vy\u0159e\u0161it chybu internal server 500 error ve WordPressu<\/a>„.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 500:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 500:<\/p>\n\n\n\n Stavov\u00fd HTTP k\u00f3d 503 ozna\u010duje do\u010dasnou nedostupnost serveru, kter\u00fd se pozd\u011bji znovu zp\u0159\u00edstupn\u00ed. Toto se d\u011bje nap\u0159. z d\u016fvodu pl\u00e1novan\u00e9 \u00fadr\u017eby (nedoporu\u010duje se), nebo v p\u0159\u00edpad\u011b, \u017ee je server p\u0159\u00edli\u0161 vyt\u00ed\u017een\u00fd.<\/p>\n\n\n\n Chyba 503 umo\u017e\u0148uje vlo\u017een\u00ed hodnoty „Retry-After“ do odpov\u011bdi, co\u017e jin\u00fdmi slovy znamen\u00e1 „Zkuste to znovu pozd\u011bji“.<\/p>\n\n\n\n Podobn\u011b jako u stavov\u00e9ho k\u00f3du HTTP 429 m\u016f\u017ee Google odstranit obsah, pokud bude opakovan\u011b dost\u00e1vat stavov\u00e9 k\u00f3dy HTTP 503 po del\u0161\u00ed dobu.<\/p>\n\n\n\n P\u0159\u00edklad spr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 503:<\/p>\n\n\n\n P\u0159\u00edklad nespr\u00e1vn\u00e9ho <\/strong>pou\u017eit\u00ed HTTP stavov\u00e9ho k\u00f3du 503:<\/p>\n\n\n\n HTTP stavov\u00fd k\u00f3d 524 ofici\u00e1ln\u011b neexistuje. Byl vymy\u0161len spole\u010dnost\u00ed Cloudflare a pou\u017e\u00edv\u00e1 se, kdy\u017e vypr\u0161\u00ed \u010das po\u017eadavku. Probl\u00e9m nen\u00ed na stran\u011b Cloudflare, ale sp\u00ed\u0161e na stran\u011b serveru, na kter\u00fd se Cloudflare spol\u00e9h\u00e1.<\/p>\n\n\n\nJak vypadaj\u00ed HTTP odpov\u011bdi? <\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
\n
Jak vypadaj\u00ed HTTP stavov\u00e9 k\u00f3dy? <\/h2>\n\n\n\n
\n
\n
Jak\u00e9 jsou nej\u010dast\u011bj\u0161\u00ed HTTP stavov\u00e9 k\u00f3dy v SEO? <\/h2>\n\n\n\n
\n
Jak zkontrolovat HTTP stavov\u00e9 k\u00f3dy? <\/h2>\n\n\n\n
Kontrola HTTP stavov\u00e9ho k\u00f3du v prohl\u00ed\u017ee\u010di pomoc\u00ed vestav\u011bn\u00fdch n\u00e1stroj\u016f.<\/h3>\n\n\n\n
\n
\n
\n
\n
Kontrola HTTP stavov\u00e9ho k\u00f3du pomoc\u00ed dopl\u0148ku prohl\u00ed\u017ee\u010de.<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Kontrola HTTP stavov\u00e9ho k\u00f3du v Google Search Console.<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Jak lze monitorovat HTTP stavov\u00e9 k\u00f3dy?<\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
R\u016fzn\u00e9 typy HTTP stav\u016f<\/h2>\n\n\n\n
\n
\n
\n
\n
\n
\n
HTTP 1xx stavov\u00e9 k\u00f3dy – jsou pouze informa\u010dn\u00ed<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
HTTP 2xx stavov\u00e9 k\u00f3dy – zna\u010d\u00ed \u00fasp\u011bch<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
HTTP 3xx stavov\u00e9 k\u00f3dy – t\u00fdkaj\u00ed se p\u0159esm\u011brov\u00e1n\u00ed<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
HTTP stavov\u00fd k\u00f3d 301: Moved permanently<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 302: Found \/ Moved temporarily<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 303: See Other<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 304: Not modified<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 307: Temporary Redirect<\/h4>\n\n\n\n
Stavov\u00fd k\u00f3d 307 jako vnit\u0159n\u00ed p\u0159esm\u011brov\u00e1n\u00ed<\/h5>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 308: Permanent Redirect<\/h4>\n\n\n\n
HTTP 4xx stavov\u00e9 k\u00f3dy<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
HTTP stavov\u00fd k\u00f3d 401: Unauthorized<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 403: Forbidden<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 404: Not Found<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 410: Gone<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 418: I’m a teapot<\/h4>\n\n\n\n
HTTP stavov\u00fd k\u00f3d 429: Too many requests<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 430: Request Header Fields Too Large<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 451: Unavailable for Legal Reasons<\/h4>\n\n\n\n
\n
\n
<\/a><\/figure>\n\n\n\n
HTTP 5xx stavov\u00e9 k\u00f3dy<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 500: Internal Server Error<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 503: Service Unavailable<\/h4>\n\n\n\n
\n
\n
HTTP stavov\u00fd k\u00f3d 524: A timeout occurred<\/h4>\n\n\n\n