Clean URL

Clean URL

Clean URLs, RESTful URLs or user-friendly URLs are purely structural URLs that do not contain a query string and instead contain only the path of the resource (after the scheme [e.g. http] and the authority [e.g. example.org]). This is often done for aesthetic, usability, or search engine optimization (SEO) purposes.[1] Other reasons for designing a clean URL structure for a website or web service include ensuring that individual resources remain under the same URL for years, which makes the World Wide Web a more stable and useful system,[2] and to make them memorable, logical, easy to type, human-centric, and long-lived.[3]

Contents

Examples

Examples of "clean" versus "unclean" URLs follow:

Unclean URL Clean URL
http://example.com/index.php?page=foo http://example.com/foo
http://example.com/index.php?page=consulting/marketing http://example.com/consulting/marketing
http://example.com/products?category=2&pid=25 http://example.com/products/2/25
http://example.com/cgi-bin/feed.cgi?feed=news&frm=rss http://example.com/news.rss
http://example.com/services/​index.jsp?category=legal&id=patents http://example.com/services/legal/patents
http://example.com/kb/index.php?cat=8&id=41 http://example.com/kb/customer​%20intelligence/sales%20forecasting
http://example.com/index.php?mod=profiles&id=193 http://example.com/user/john-doe
http://example.com/app/​dashboard/dsptchr_c80.dll?page=38661&mod1=bnr_ant&UID=4511681&SESSID=4fd8b561ac867195fba2cc5679&... http://example.com/app/dashboard/reports#monthly

Reasoning and common practices

The most often cited reasons for using clean URLs is for search engine optimization, but clean URLs can also greatly improve usability and accessibility. Removing unnecessary parts, simplifies URLs and makes them easier to type and remember.[4]

But there can also be different levels of cleanness. It is usually recommended[by whom?] for usability and SEO purposes to make URLs descriptive; so when planning the structure of clean URLs, webmasters often take this opportunity to include relevant keywords in the URL and remove irrelevant words from it. So common words like "the", "and", "an", "a", etc. are often stripped out to further trim down the URL while descriptive keywords are added to increase user-friendliness and improve search engine ranking.[1] This includes replacing hard-to-remember numerical IDs with the name of the resource it refers to. And, because not all resources have URL-friendly names due to the character set restrictions on web URLs or length, it is common practice to generate a slug that is truncated to a certain length and has any invalid characters replaced with human-readable characters. This also eliminates ugly and hard to remember URL-encoded strings (e.g. Peanut%20M%26Ms becomes Peanut_MMs).

Similarly, it is common practice to replace cryptic variable names and parameters with friendly names or to simply do away with them altogether. Shorter URLs that don't contain any esoteric abbreviations or complex syntax that is alien to the average user are less intimidating and contribute to overall usability.

Another aspect of clean URLs is that they do not contain implementation details of the underlying web application.[4] For example, many URLs include the filename of a server-side script, such as "example.php", "example.asp" or "cgi-bin". Such details are irrelevant to the user and do not serve to identify the content, and make it harder to change the implementation of the server at a later date. For example, if a script at "example.php" is rewritten in Python, the URL will have to change, or rewrite rules will need to be used to allow the old URL to redirect to the new one.

See also

References

  1. ^ a b Opitz, Pascal (2006-02-28). "Clean URLs for better search engine ranking". Content with Style. http://www.contentwithstyle.co.uk/content/clean-urls-for-a-better-search-engine-ranking. Retrieved 2010-09-09. 
  2. ^ Berners-Lee, Tim (1998). "Cool URIs don't change". Style Guide for online hypertext. W3C. http://www.w3.org/Provider/Style/URI.html. Retrieved 6 March 2011. 
  3. ^ Neath, Kyle (2010). "URL Design". http://warpspire.com/posts/url-design/. Retrieved 6 March 2011. 
  4. ^ a b Jacek, Jonas (2011). "Clean URL Design - Guidelines". http://rield.com/how-to/url-design. Retrieved 6 March 2011. 

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Clean URL — Eine Clean URL oder Pretty URL (deutsch etwa saubere URL, hübsche URL), umgangssprachlich auch als sprechende URL bezeichnet, ist ein Uniform Resource Locator, der keine searchpart [1] oder query Komponente[2] enthält, sondern nur den Pfad zu… …   Deutsch Wikipedia

  • URL shortening — For information about human generated short URLs on Wikipedia, see WP:WP and mw:Manual:Short URL. URL shortening is a technique on the World Wide Web in which a Uniform Resource Locator (URL) may be made substantially shorter in length and still… …   Wikipedia

  • Clean URLs — (dt. saubere URLs oder sprechende URLs) (bzw. URIs) sind URLs, die nichts über die genutzte Technologie preisgeben sondern nur die Ressource selbst beschreiben. Man sieht z. B. kein cgi bin oder cgi im Pfad und selbst die Dateiendungen (z. B. htm …   Deutsch Wikipedia

  • Clean Freak Patrol — is a brand name that is an attempt to teach kids about hand washing while selling a variety of products such as soaps and hand sanitizers. It is an example of cause related marketing in Canada, and a local independent brand entering a the… …   Wikipedia

  • Clean Living Movements — A Clean Living Movement is a period of time when a surge of health reform crusades, many with moral overtones, erupts into the popular consciousness. This results in individual, or group reformers such as the anti tobacco or alcohol coalitions of …   Wikipedia

  • Holme Moor & Clean Moor — Infobox SSSI name=Holme Moor Clean Moor aos=Somerset interest=Biological gridref=gbmappingsmall|ST095260 area=10.8 hectare (26.7 acre) notifydate=1987 http://www.natureonthemap.org.uk/map.aspx? ] Holme Moor Clean Moor (gbmapping|ST095260) is a 10 …   Wikipedia

  • Living Clean — is a Canadian television program, and Canada s only live interactive weekly talk show designed to assist individuals suffering with addiction and/or mental illnesses. According to the shows website, [Cite web|url=http://www.livingclean.ca… …   Wikipedia

  • How to Clean Everything — Infobox Album | Name = How to Clean Everything Type = Album Artist = Propagandhi Released = 1993 Recorded = February 1993 Genre = Pop punk Length = 33:33 Label = Fat Wreck Chords Producer = ? Reviews = *Allmusic Rating|4|5… …   Wikipedia

  • Rewrite engine — In Wikipedia and other MediaWiki sites, see MediaWiki Manual:Short URL. A rewrite engine is software that modifies a web URL s appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly SEF) are… …   Wikipedia

  • International Rugby Board — Infobox Organization name = International Rugby Board size = 170 px motto = type = Sports federation formation = 1886 headquarters = Dublin, Ireland membership = 115 unions leader title = Chairman leader name = Bernard Lapasset website=… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”