{"id":206,"date":"2019-07-07T14:24:03","date_gmt":"2019-07-07T12:24:03","guid":{"rendered":"https:\/\/pomoc.lh.pl\/?p=206"},"modified":"2021-10-20T14:21:49","modified_gmt":"2021-10-20T12:21:49","slug":"mod_rewrite","status":"publish","type":"docs","link":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/","title":{"rendered":"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107?"},"content":{"rendered":"\n<p>Mod_rewrite to funkcja serwera WWW Apache. Daje ona mo\u017cliwo\u015b\u0107 manipulowania adresami URL poprzez tworzenie r\u00f3\u017cnego rodzaju regu\u0142. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Przyk\u0142ady zastosowania<\/h2>\n\n\n\n<ul><li>Tworzenie przyjaznych link\u00f3w URL, kt\u00f3re zast\u0105pi\u0105 &#8222;brzydkie&#8221; adresy. Je\u017celi nie chcesz by  URL wygl\u0105da\u0142 tak: <strong>https:\/\/przyklad.pl\/blog\/news=produkt.php&amp;new=1567<\/strong>, dzi\u0119ki mod_rewrite stworzysz link: <strong>https:\/\/przyklad.pl\/blog\/produkt<\/strong><\/li><li>Mod_rewrite pozwala na ustawianie link\u00f3w kanonicznych, czyli takich, kt\u00f3re umo\u017cliwiaj\u0105 zdefiniowane link\u00f3w w wybrany przez nas spos\u00f3b. Dzi\u0119ki tej funkcji unikniesz duplikacji tre\u015bci, bo roboty wyszukiwarek otrzymaj\u0105 jednoznaczn\u0105 informacj\u0119, kt\u00f3ry adres jest g\u0142\u00f3wny. Tworzenie link\u00f3w kanonicznych przyda si\u0119, gdy chcesz ustawi\u0107 jedn\u0105 wersj\u0119 strony, np. adres z WWW lub bez WWW, http lub https. <\/li><li>Unikanie b\u0142\u0119d\u00f3w 404 po wykonywaniu zmian w linkach strony. Je\u017celi zmienia\u0142e\u015b struktur\u0119 link\u00f3w na swojej stronie, mod_rewrite pomo\u017ce Ci w ustawieniu regu\u0142, kt\u00f3re mog\u0105 mapowa\u0107 wszystkie stare adresy URL do nowego formatu. <\/li><li>Tworzenie przekierowa\u0144, np. najpopularniejszego <strong><a href=\"https:\/\/www.lh.pl\/pomoc\/doc\/przekierowanie-301\/\" target=\"_blank\" rel=\"noreferrer noopener\">przekierowania 301<\/a><\/strong>. <\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Jak w\u0142\u0105czy\u0107 mod_rewrite na serwerach LH.pl?<\/h2>\n\n\n\n<p>W celu aktywacji&nbsp;&nbsp;<strong>mod_rewrite<\/strong>&nbsp;na serwerach LH.pl, nale\u017cy w pliku&nbsp;<strong>.htaccess<\/strong>&nbsp;znajduj\u0105cym si\u0119 w katalogu ze stron\u0105 doda\u0107 wpis:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\nRewriteBase \/<\/pre>\n\n\n\n<p>Po dodaniu wpisu zapisz zmiany. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mod_rewrite to funkcja serwera WWW Apache. Daje ona mo\u017cliwo\u015b\u0107 manipulowania adresami URL poprzez tworzenie r\u00f3\u017cnego rodzaju regu\u0142. Przyk\u0142ady zastosowania Tworzenie [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10702,"template":"","tags":[],"kategoria":[4],"blocksy_meta":{"has_transparent_header":"default","has_header_top_bar":"default","transparentHeaderFontColor":{"default":{"color":"#ffffff"},"hover":{"color":"var(--theme-palette-color-1)"}},"transparentHeaderBackground":{"default":{"color":"rgba(255, 255, 255, 0.1)"}},"page_structure_type":"default","page_enable_vertical_spacing":"yes","has_hero_section":"default","hero_section":"type-1","hero_alignment1":"left","hero_alignment2":"center","has_meta":"yes","02f9215f0cad1eb0683f2b6913d5c3f7":"","hero_height":"230px","b535f5c50d05e6f213e8785e9e73b93e":"","page_title_bg_type":"color","8fd9f0407b9c94567fb43ddc24486b17":"","custom_hero_background":{"attachment_id":null},"enable_parallax":"no","6b5df81929e11f9fd91315c3a5036544":"","page_excerpt_visibility":{"desktop":true,"tablet":true,"mobile":false},"pageTitleFont":{"family":"Default","variation":"n7","size":{"desktop":"32px","tablet":"30px","mobile":"25px"},"line-height":"1.3","letter-spacing":"0em","text-transform":"none","text-decoration":"none"},"pageTitleFontColor":{"default":{"color":"var(--theme-palette-color-4)"},"hover":{"color":"var(--theme-palette-color-1)"}},"pageTitleOverlay":{"default":{"color":"rgba(41, 51, 60, 0.2)"}},"pageTitleBackground":{"default":{"color":"#EDEFF2"}},"9d9cd3dd73f53454e479f8eeff2b4cad":"","9c47dc23598557b66cd621cf123a8e27":"","8c70c622edd71f10e0fb898927c1f4ba":"","92f2c3a07d438cf6414bf4e4a437d572":"","181a43abde266ef67bf2ba055d630322":"","4a45f7365dcb0e10a0d9f7271f818a7d":"","5dec535669d0f2ebcb735cb993ab05ac":"","fac0e02b2c908d032c92f407c32211c0":"","7678d232735874ef541af9c0bb3d908a":"","f3faa91a5699207882048aa9d6b9d419":"","9945bb8e3372ae6deb176a6c6dc4590e":"","69a71461f34ed364a8450e09ba294561":"","styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"acf":[],"featured_image_urls":{"full":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png",1280,720,false],"thumbnail":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder-150x150.png",150,150,true],"medium":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder-300x169.png",300,169,true],"medium_large":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder-768x432.png",768,432,true],"large":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder-1024x576.png",1024,576,true],"1536x1536":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png",1280,720,false],"2048x2048":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png",1280,720,false],"yarpp-thumbnail":["https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png",120,68,false]},"post_excerpt_stackable":"<p>Mod_rewrite to funkcja serwera WWW Apache. Daje ona mo\u017cliwo\u015b\u0107 manipulowania adresami URL poprzez tworzenie r\u00f3\u017cnego rodzaju regu\u0142. Przyk\u0142ady zastosowania Tworzenie przyjaznych link\u00f3w URL, kt\u00f3re zast\u0105pi\u0105 &#8222;brzydkie&#8221; adresy. Je\u017celi nie chcesz by URL wygl\u0105da\u0142 tak: https:\/\/przyklad.pl\/blog\/news=produkt.php&amp;new=1567, dzi\u0119ki mod_rewrite stworzysz link: https:\/\/przyklad.pl\/blog\/produktMod_rewrite pozwala na ustawianie link\u00f3w kanonicznych, czyli takich, kt\u00f3re umo\u017cliwiaj\u0105 zdefiniowane link\u00f3w w wybrany przez nas spos\u00f3b. Dzi\u0119ki tej funkcji unikniesz duplikacji tre\u015bci, bo roboty wyszukiwarek otrzymaj\u0105 jednoznaczn\u0105 informacj\u0119, kt\u00f3ry adres jest g\u0142\u00f3wny. Tworzenie link\u00f3w kanonicznych przyda si\u0119, gdy chcesz ustawi\u0107 jedn\u0105 wersj\u0119 strony, np. adres z WWW lub bez WWW, http lub https. Unikanie b\u0142\u0119d\u00f3w 404 po wykonywaniu zmian w&hellip;<\/p>\n","category_list":"","author_info":{"name":"dzialpomocy","url":"https:\/\/www.lh.pl\/pomoc\/author\/dzialpomocy\/"},"comments_num":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107? - LH.pl<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107? - LH.pl\" \/>\n<meta property=\"og:description\" content=\"Mod_rewrite to funkcja serwera WWW Apache. Daje ona mo\u017cliwo\u015b\u0107 manipulowania adresami URL poprzez tworzenie r\u00f3\u017cnego rodzaju regu\u0142. Przyk\u0142ady zastosowania Tworzenie [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/\" \/>\n<meta property=\"og:site_name\" content=\"LH.pl\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wwwlhpl\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-20T12:21:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Szacowany czas czytania\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minuta\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/\",\"url\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/\",\"name\":\"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107? - LH.pl\",\"isPartOf\":{\"@id\":\"https:\/\/www.lh.pl\/pomoc\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png\",\"datePublished\":\"2019-07-07T12:24:03+00:00\",\"dateModified\":\"2021-10-20T12:21:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#breadcrumb\"},\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#primaryimage\",\"url\":\"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png\",\"contentUrl\":\"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lh.pl Pomoc\",\"item\":\"https:\/\/www.lh.pl\/pomoc\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dzia\u0142 pomocy\",\"item\":\"https:\/\/www.lh.pl\/pomoc\/docs\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.lh.pl\/pomoc\/#website\",\"url\":\"https:\/\/www.lh.pl\/pomoc\/\",\"name\":\"LH.pl\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.lh.pl\/pomoc\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.lh.pl\/pomoc\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pl-PL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.lh.pl\/pomoc\/#organization\",\"name\":\"LH.pl\",\"url\":\"https:\/\/www.lh.pl\/pomoc\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/www.lh.pl\/pomoc\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2019\/09\/LH-logo-color-RGB.png\",\"contentUrl\":\"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2019\/09\/LH-logo-color-RGB.png\",\"width\":771,\"height\":289,\"caption\":\"LH.pl\"},\"image\":{\"@id\":\"https:\/\/www.lh.pl\/pomoc\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/wwwlhpl\",\"https:\/\/www.instagram.com\/wwwlhpl\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107? - LH.pl","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/","og_locale":"pl_PL","og_type":"article","og_title":"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107? - LH.pl","og_description":"Mod_rewrite to funkcja serwera WWW Apache. Daje ona mo\u017cliwo\u015b\u0107 manipulowania adresami URL poprzez tworzenie r\u00f3\u017cnego rodzaju regu\u0142. Przyk\u0142ady zastosowania Tworzenie [&hellip;]","og_url":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/","og_site_name":"LH.pl","article_publisher":"https:\/\/www.facebook.com\/wwwlhpl","article_modified_time":"2021-10-20T12:21:49+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Szacowany czas czytania":"1 minuta"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/","url":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/","name":"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107? - LH.pl","isPartOf":{"@id":"https:\/\/www.lh.pl\/pomoc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#primaryimage"},"image":{"@id":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png","datePublished":"2019-07-07T12:24:03+00:00","dateModified":"2021-10-20T12:21:49+00:00","breadcrumb":{"@id":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/"]}]},{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#primaryimage","url":"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png","contentUrl":"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2021\/11\/placeholder.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.lh.pl\/pomoc\/doc\/mod_rewrite\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Lh.pl Pomoc","item":"https:\/\/www.lh.pl\/pomoc\/"},{"@type":"ListItem","position":2,"name":"Dzia\u0142 pomocy","item":"https:\/\/www.lh.pl\/pomoc\/docs\/"},{"@type":"ListItem","position":3,"name":"Co to jest modu\u0142 mod_rewrite i jak go aktywowa\u0107?"}]},{"@type":"WebSite","@id":"https:\/\/www.lh.pl\/pomoc\/#website","url":"https:\/\/www.lh.pl\/pomoc\/","name":"LH.pl","description":"","publisher":{"@id":"https:\/\/www.lh.pl\/pomoc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lh.pl\/pomoc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pl-PL"},{"@type":"Organization","@id":"https:\/\/www.lh.pl\/pomoc\/#organization","name":"LH.pl","url":"https:\/\/www.lh.pl\/pomoc\/","logo":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/www.lh.pl\/pomoc\/#\/schema\/logo\/image\/","url":"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2019\/09\/LH-logo-color-RGB.png","contentUrl":"https:\/\/www.lh.pl\/pomoc\/wp-content\/uploads\/2019\/09\/LH-logo-color-RGB.png","width":771,"height":289,"caption":"LH.pl"},"image":{"@id":"https:\/\/www.lh.pl\/pomoc\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/wwwlhpl","https:\/\/www.instagram.com\/wwwlhpl\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/docs\/206"}],"collection":[{"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/users\/1"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/media\/10702"}],"wp:attachment":[{"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/tags?post=206"},{"taxonomy":"kategoria","embeddable":true,"href":"https:\/\/www.lh.pl\/pomoc\/wp-json\/wp\/v2\/kategoria?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}