Semantic URLs , aussi Sometimes Referred to as clean URLs , RESTful URLs , user-friendly URLs , or search engine-friendly URLs , are Uniform Resource Locators (URLs) Intended to Improve the usability and accessibility of a website or web service by being white time immediately and intuitively meaningful to non-expert users . Such URLs tend to reflect the conceptual structure of a collection of information and decouple the user interfacefrom a server’s internal representation of information. Other reasons for using clean URLs include search engine optimization (SEO), [1] conforming to the representational state transfer (REST) ​​style of software architecture, and ensuring that individual web resources remain consistently at the same URL. This makes the World Wide Web a more stable and useful system, and enables more sustainable and reliable bookmarking of web resources. [2]

Semantic URLs also include the details of the underlying web application. This carries the benefit of reducing the difficulty of implementing the resource at a later date. For example, many non-semantic URLs include the filename of a server-side script , such asexample.phpexample.asp gold cgi-bin. If the underlying implementation of a resource is changed, such URLs would need to change along with it. Likewise, where URLs are non-semantic, if the site is moved or restructured it has the potential to cause broken links , both internally and from external sites, the latter of which can lead to removal from search engine listings. The use of semantic URLs present a consistent location for resources to user-agents Regardless of internal structure. A further potential benefit to the use of semantic URLs is that the concealment of an internal application or application can improve the security of a system.

Structure

A non-semantic URL is typically composed of a path , script name, and query string . The query string parameters dictates the content to be used by the user, and frequently includes information that is irrelevant to users-such as internal numeric identifiers for values ​​in a database , illegibly-encoded data, session IDs , implementation details, and so on. Semantic 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.

Non-semantic URL Semantic URL
http://example.com/index.php?page=name http://example.com/name
http://example.com/about.html http://example.com/about
http://example.com/index.php?page=consulting/marketing http://example.com/consulting/marketing
http://example.com/products?category=12&pid=25 http://example.com/products/12/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/8/41
http://example.com/index.php?mod=profiles&id=193 http://example.com/profiles/193
http://en.wikipedia.org/w/index.php?title=Semantic_URL http://en.wikipedia.org/wiki/Semantic_URL

Implementation

The implementation of semantic URLs involves URL mapping through pattern matching or transparent rewriting techniques. As this usually takes place on the server side, the semantic URL is often used by the user.

For search engine optimization purposes, web developers often take this opportunity to include keywords in the URL and remove irrelevant words. Common Words That are removed include items and conjunctions , while descriptive keywords are added pour augmenter user-friendliness and Improve search engine rankings. [1]

A fragment can be included at the end of a semantic URL for references within a page, and need not be user-readable. [3]

Slug

Some systems define a slug as the hand of a URL That page has identified in human-readable keywords. [4] [5] It is usually the end portion of the URL, qui peut être construed as the name of the resource, similar to the basename in a filename or the title of a page. The name is based on the use of the word slug in the news media to indicate indication has short name Given To an item for internal use.

Slugs are typically generated automatically, but can be used for other purposes. Long page titles may also be truncated to keep the final URL to a reasonable length.

Slugs are Generally Entirely lowercase, with accented characters Replaced by letters from the English alphabet and whitespace characters Replaced by a dash or an underscore to Avoid being white encoded . Punctuation marks are generally removed, and some also remove short, common words such as conjunctions . For example:

  • Original title: This, That and the Other! An Outré Collection
  • Generated slug: this-that-other-outre-collection

See also

  • Architecture Information
  • Permalink
  • Persistent uniform resource locator (PURL)
  • URL normalization
  • Redirect URL
  • Shortening URL
  • HTTP referer § Refer hiding

References

  1. ^ Jump up to:b Opitz, Pascal (28 February 2006). “Clean URLs for better search engine ranking” . Content with Style . Retrieved 9 September 2010 .
  2. Jump up^ Berners-Lee, Tim (1998). “Cool URIs do not change” . Style Guide for online hypertext . W3C . Retrieved 6 March 2011 .
  3. Jump up^ “Uniform Resource Identifier (URI): Generic Syntax” . RFC 3986 . Internet Engineering Task Force . Retrieved 2 May 2014 .
  4. Jump up^ Slug in the WordPress glossary
  5. Jump up^ Slug in the Django glossary