{"id":24354,"date":"2010-04-21T00:00:00","date_gmt":"2010-04-21T00:00:00","guid":{"rendered":"https:\/\/alienroad.com\/google-bilgi-bankasi\/to-slash-or-not-to-slash\/"},"modified":"2010-04-21T00:00:00","modified_gmt":"2010-04-21T00:00:00","slug":"to-slash-or-not-to-slash","status":"publish","type":"ar_kb","link":"https:\/\/alienroad.com\/google-bilgi-bankasi\/to-slash-or-not-to-slash\/","title":{"rendered":"To slash or not to slash"},"content":{"rendered":"<p class=\"gargardate\">Wednesday, April 21, 2010<\/p>\n<p>\n  That is the question we hear often. Onward to the answers! Historically, it&#8217;s common for URLs with<br \/>\n  a trailing slash to indicate a directory, and those without a trailing slash to denote a file:\n<\/p>\n<div><\/div>\n<p>\n  But they certainly don&#8217;t have to. Google treats each URL above separately (and equally) regardless<br \/>\n  of whether it&#8217;s a file or a directory, or it contains a trailing slash or it doesn&#8217;t contain a<br \/>\n  trailing slash.\n<\/p>\n<h2 id=\"different-content-on-slash-and-non-slash-urls-is-okay-for-google,-but-often-is-less-ideal-for-users\" tabindex=\"-1\">Different content on slash and non-slash URLs is okay for Google, but often is less ideal for users<\/h2>\n<p>\n  From a technical, search engine standpoint, it&#8217;s certainly permissible for these two URL versions<br \/>\n  to contain different content. Your users, however, may find this configuration horribly<br \/>\n  confusing&mdash;just imagine if <code>www.google.com\/webmasters<\/code> and<br \/>\n  <code>www.google.com\/webmasters\/<\/code> produced two separate experiences.\n<\/p>\n<p>\n  For this reason, trailing slash and non-trailing slash URLs often serve the same content. The most<br \/>\n  common case is when a site is configured with a directory structure:\n<\/p>\n<div><\/div>\n<h2 id=\"your-sites-configuration-and-your-options\" tabindex=\"-1\">Your site&#8217;s configuration and your options<\/h2>\n<p>\n  You can do a quick check on your site to see if either of the URLs matching this pattern<br \/>\n  <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/redirects-and-google\/\">redirects<\/a> to the other:\n<\/p>\n<ol>\n<li>\n   <code>https:\/\/example.com\/foo\/<\/code><br \/>\n   <br \/>\n   (with trailing slash)\n <\/li>\n<li>\n   <code>https:\/\/example.com\/foo<\/code><br \/>\n   <br \/>\n   (no trailing slash)\n <\/li>\n<\/ol>\n<ul>\n<li>\n   If only one version can be returned (that is, the other redirects to it), that&#8217;s great! This<br \/>\n   behavior is beneficial because it reduces<br \/>\n   <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/specify-canonical\/\">duplicate content<\/a>. In the<br \/>\n   particular case of redirects to trailing slash URLs, our search results will likely show the<br \/>\n   version of the URL with the<br \/>\n   <a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_HTTP_status_codes\" class=\"external-link\"><code>200<\/code> response code<\/a><br \/>\n   (most often the trailing slash URL)&mdash;regardless of whether the redirect was a<br \/>\n   <code>301<\/code> \u0438\u043b\u0438 <code>302<\/code>.\n <\/li>\n<li>\n   If both slash and non-trailing-slash versions contain the same content and each returns<br \/>\n   <code>200<\/code>, you can:<\/p>\n<ul>\n<li>\n       Consider changing this behavior (more info below) to reduce duplicate content and improve<br \/>\n       <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/optimize-your-crawling-and-indexing\/\">crawl efficiency<\/a>.\n     <\/li>\n<li>\n       Leave it as-is. Many sites have duplicate content. Our indexing process often handles this<br \/>\n       case for webmasters and users. While it&#8217;s not totally optimal behavior, it&#8217;s perfectly<br \/>\n       legitimate and a-okay. \ud83d\ude42\n     <\/li>\n<li>\n       Rest assured that for your root URL specifically, <code>https:\/\/example.com<\/code> is<br \/>\n       equivalent to <code>https:\/\/example.com\/<\/code> and can&#8217;t be redirected even if you&#8217;re Chuck<br \/>\n       Norris.\n     <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"steps-for-serving-only-one-url-version\" tabindex=\"-1\">Steps for serving only one URL version<\/h2>\n<p>What if your site serves duplicate content on these two URLs:<\/p>\n<div><\/div>\n<p>\n  Meaning that both URLs return <code>200<\/code> (neither has a redirect or contains<br \/>\n  <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/specify-canonical\/\"><code>rel=\"canonical\"<\/code> link tag<\/a><br \/>\n  ), and you want to change the situation?\n<\/p>\n<ol>\n<li>\n    Choose one URL as the preferred version. If your site has a directory structure, it&#8217;s more<br \/>\n    conventional to use a trailing slash with your directory URLs (for example,<br \/>\n    <code>example.com\/directory\/<\/code> rather than <code>example.com\/directory<\/code>), but you can<br \/>\n    choose whichever you like.\n  <\/li>\n<li>\n    Be consistent with the preferred version. Use it in your internal links. If you have a<br \/>\n    <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/sitemaps-overview\/\">sitemap<\/a>, include the preferred version<br \/>\n    (and don&#8217;t include the duplicate URL).\n  <\/li>\n<li>\n    Use a <code>301<\/code> redirect from the duplicate to the preferred version. If that&#8217;s not<br \/>\n    possible, the <code>rel=\"canonical\"<\/code> link tag is a strong option.<br \/>\n    <code>rel=\"canonical\"<\/code> works similarly to a <code>301<\/code> for Google&#8217;s indexing<br \/>\n    purposes, and other major search engines as well.\n  <\/li>\n<li>\n    Test your <code>301<\/code> configuration through<br \/>\n    <a href=\"https:\/\/support.google.com\/webmasters\/answer\/9128668\" class=\"external-link\">Fetch as Googlebot<\/a><br \/>\n    in <a href=\"https:\/\/search.google.com\/search-console\" class=\"external-link\">Webmaster Tools<\/a>.<br \/>\n    Make sure your URLs, <code>https:\/\/example.com\/foo\/<\/code> and<br \/>\n    <code>https:\/\/example.com\/foo<\/code>, are behaving as expected. The preferred version should<br \/>\n    return a <code>200<\/code> status code. The duplicate URL should <code>301<\/code> redirect to the<br \/>\n    preferred URL.\n  <\/li>\n<li>\n    Check for<br \/>\n    <a href=\"https:\/\/support.google.com\/webmasters\/answer\/9679690\" class=\"external-link\">Crawl errors<\/a><br \/>\n    in Webmaster Tools, and, if possible, your webserver logs as a quick check that the<br \/>\n    <code>301<\/code> redirects are implemented.\n  <\/li>\n<li>\n    Profit! (just kidding) But you can bask in the sunshine of your efficient server configuration,<br \/>\n    warmed by the knowledge that your site is better optimized.\n  <\/li>\n<\/ol>\n<p class=\"byline-author\">Written by <a href=\"https:\/\/developers.google.com\/search\/blog\/authors\/maile-ohye\">Maile Ohye<\/a>, Developer Programs Tech Lead<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wednesday, April 21, 2010 That is the question we hear often. Onward to the answers! Historically, it&#8217;s common for URLs with a trailing slash to indicate a directory, and those without a trailing slash to denote a file: But they certainly don&#8217;t have to. Google treats each URL above separately (and equally) regardless of whether [&hellip;]<\/p>\n","protected":false},"menu_order":85280,"template":"","meta":{"footnotes":""},"ar_kb_kategori":[665],"ar_kb_etiket":[],"class_list":["post-24354","ar_kb","type-ar_kb","status-publish","has-post-thumbnail","hentry","ar_kb_kategori-blog"],"_links":{"self":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/24354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb"}],"about":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/types\/ar_kb"}],"version-history":[{"count":0,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/24354\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media\/26785"}],"wp:attachment":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media?parent=24354"}],"wp:term":[{"taxonomy":"ar_kb_kategori","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_kategori?post=24354"},{"taxonomy":"ar_kb_etiket","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_etiket?post=24354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}