{"id":1691,"date":"2022-03-07T16:26:31","date_gmt":"2022-03-07T20:26:31","guid":{"rendered":"https:\/\/ten30media.com\/sapnew\/?p=1691"},"modified":"2022-03-07T16:27:28","modified_gmt":"2022-03-07T20:27:28","slug":"clean-url","status":"publish","type":"post","link":"https:\/\/ten30media.com\/sapnew\/clean-url\/","title":{"rendered":"Clean URL"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-1692 size-full\" src=\"https:\/\/ten30media.com\/sapnew\/wp-content\/uploads\/2022\/03\/Clean-URL.jpg\" alt=\"\" width=\"473\" height=\"266\" srcset=\"https:\/\/ten30media.com\/sapnew\/wp-content\/uploads\/2022\/03\/Clean-URL.jpg 473w, https:\/\/ten30media.com\/sapnew\/wp-content\/uploads\/2022\/03\/Clean-URL-300x169.jpg 300w\" sizes=\"(max-width: 473px) 100vw, 473px\" \/><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Clean URLs<\/strong>, also sometimes referred to as\u00a0<strong>RESTful URLs<\/strong>,\u00a0<strong>user-friendly URLs<\/strong>,\u00a0<strong>pretty URLs<\/strong>\u00a0or\u00a0<strong>search engine-friendly URLs<\/strong>, are\u00a0<u>URLs<\/u>\u00a0intended to improve the\u00a0usability\u00a0and\u00a0accessibility\u00a0of a\u00a0website\u00a0or\u00a0web service\u00a0by being immediately and intuitively meaningful to non-expert\u00a0users. Such URL schemes tend to reflect the conceptual structure of a collection of information and\u00a0decouple\u00a0the\u00a0user interface\u00a0from a server&#8217;s internal representation of information. Other reasons for using clean URLs include\u00a0search engine optimization\u00a0(SEO),<sup>[<\/sup>\u00a0conforming to the\u00a0representational state transfer\u00a0(REST) style of software architecture, and ensuring that individual\u00a0web resources\u00a0remain consistently at the same URL. This makes the\u00a0World Wide Web\u00a0a more stable and useful system, and allows more durable and reliable\u00a0bookmarking\u00a0of web resources.<\/p>\n<p>Clean URLs also do not contain implementation details of the underlying web application. This carries the benefit of reducing the difficulty of changing the implementation of the resource at a later date. For example, many URLs include the filename of a\u00a0server-side script, such as\u00a0example.php,\u00a0example.asp\u00a0or\u00a0cgi-bin. If the underlying implementation of a resource is changed, such URLs would need to change along with it. Likewise, when URLs are not &#8220;clean&#8221;, if the site database is moved or restructured it has the potential to cause\u00a0broken links, both internally and from external sites, the latter of which can lead to removal from\u00a0search engine\u00a0listings. The use of clean URLs presents a consistent location for resources to\u00a0user-agents\u00a0regardless of internal structure. A further potential benefit to the use of clean URLs is that the concealment of internal server or application information can improve the\u00a0security\u00a0of a system.<\/p>\n<p>Table of Contents<\/p>\n<ul>\n<li>Structure<\/li>\n<li>Implementation<\/li>\n<li>Slug<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Structure<\/strong><\/p>\n<p>A URL will often comprise a\u00a0path, script name, and\u00a0query string. The query string parameters dictate the content to show on the page, and frequently include information opaque or irrelevant to users\u2014such as internal numeric\u00a0identifiers\u00a0for values in a\u00a0database, illegibly\u00a0encoded\u00a0data,\u00a0session IDs, implementation details, and so on. Clean URLs, by contrast, contain only the path of a resource, in a hierarchy that reflects some logical structure that users can easily interpret and manipulate.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Original URL<\/strong><\/td>\n<td><strong>Clean URL<\/strong><\/td>\n<\/tr>\n<tr>\n<td>http:\/\/example.com\/about.html<\/td>\n<td>http:\/\/example.com\/about<\/td>\n<\/tr>\n<tr>\n<td>http:\/\/example.com\/user.php?id=1<\/td>\n<td>http:\/\/example.com\/user\/1<\/td>\n<\/tr>\n<tr>\n<td>http:\/\/example.com\/index.php?page=name<\/td>\n<td>http:\/\/example.com\/name<\/td>\n<\/tr>\n<tr>\n<td>http:\/\/example.com\/kb\/index.php?cat=1&amp;id=23<\/td>\n<td>http:\/\/example.com\/kb\/1\/23<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/en.wikipedia.org\/w\/index.php?title=Clean_URL\">http:\/\/en.wikipedia.org\/w\/index.php?title=Clean_URL<\/a><\/td>\n<td><a href=\"https:\/\/en.wikipedia.org\/wiki\/Clean_URL\">http:\/\/en.wikipedia.org\/wiki\/Clean_URL<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>Implementation<\/h2>\n<p>The implementation of clean URLs involves\u00a0URL mapping\u00a0via pattern matching or transparent\u00a0rewriting\u00a0techniques. As this usually takes place on the server side, the clean URL is often the only form seen by the user.<\/p>\n<p>For search engine optimization purposes, web developers often take this opportunity to include relevant keywords in the URL and remove irrelevant words. Common words that are removed include\u00a0articles\u00a0and\u00a0conjunctions, while descriptive keywords are added to increase user-friendliness and improve search engine rankings.<\/p>\n<p>A\u00a0fragment identifier\u00a0can be included at the end of a clean URL for references within a page, and need not be user-readable.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Slug<\/strong><\/p>\n<p>Some systems define a\u00a0<em>slug<\/em>\u00a0as the part of a URL that identifies a page in\u00a0human-readable\u00a0keywords.\u00a0It is usually the end part of the URL (specifically of the\u00a0path\u00a0\/\u00a0pathinfo\u00a0part), which can be interpreted as the name of the resource, similar to the\u00a0basename\u00a0in a\u00a0filename\u00a0or the title of a page. The name is based on the use of the word\u00a0<em>slug<\/em>\u00a0in the news media to indicate a short name given to an article for internal use.<\/p>\n<p>Slugs are typically generated automatically from a page title but can also be entered or altered manually, so that while the page title remains designed for display and human readability, its slug may be optimized for brevity or for consumption by search engines, as well as providing recipients of a shared bare URL with the rough idea of the page&#8217;s topic. Long page titles may also be truncated to keep the final URL to a reasonable length.<\/p>\n<p>Slugs may be entirely lowercase, with accented characters replaced by letters from the\u00a0Latin script\u00a0and\u00a0whitespace characters\u00a0replaced by a\u00a0hyphen\u00a0or an\u00a0underscore\u00a0to avoid being\u00a0encoded. Punctuation marks are generally removed, and some also remove short, common words such as\u00a0conjunctions. For example, the title\u00a0<em>This, That, and the Other! An Outr\u00e9 Collection<\/em>\u00a0could have a generated slug of\u00a0this-that-other-outre-collection.<\/p>\n<p>Another benefit of URL slugs is the facilitated ability to find a desired page out of a long list of URLs without page titles, such as a minimal list of opened\u00a0tabs\u00a0exported using a\u00a0browser extension, and the ability to preview the approximate title of a target page in the browser if\u00a0hyperlinked\u00a0to without title.<\/p>\n<p>Web sites that make use of slugs include\u00a0Stack Exchange Network\u00a0with question title after slash, and\u00a0Instagram\u00a0with\u00a0?taken-by=<em>username<\/em>\u00a0URL parameter.<\/p>\n<p><sup>\u00a0Source: Wikipedia, the free encyclopedia<\/sup><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 Clean URLs, also sometimes referred to as\u00a0RESTful URLs,\u00a0user-friendly URLs,\u00a0pretty URLs\u00a0or\u00a0search engine-friendly URLs, are\u00a0URLs\u00a0intended to improve the\u00a0usability\u00a0and\u00a0accessibility\u00a0of a\u00a0website\u00a0or\u00a0web service\u00a0by being immediately and intuitively meaningful to non-expert\u00a0users. Such URL schemes tend to reflect the conceptual structure of a collection of information and\u00a0decouple\u00a0the\u00a0user interface\u00a0from a server&#8217;s internal representation of information. Other reasons for using clean URLs include\u00a0search [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/posts\/1691"}],"collection":[{"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/comments?post=1691"}],"version-history":[{"count":0,"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/posts\/1691\/revisions"}],"wp:attachment":[{"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/media?parent=1691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/categories?post=1691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ten30media.com\/sapnew\/wp-json\/wp\/v2\/tags?post=1691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}