Clean url

from Wikipedia, the free encyclopedia

A Clean URL or pretty URL (German clean URL or pretty URL ) is a Uniform Resource Locator (URL), the readable words rather than technical shortcuts or database IDs contains. There are no searchpart or query components or file name extensions such as. B. .html , .php , or other information used server technology such as cgi-bin or cgi included. Instead, readable and descriptive titles or lexicographical lemmas , calendar dates (mostly of the appearance) and also the language of the content (mostly abbreviated according to ISO 639 ) are used in the URL.

In web development, one speaks of " slug " and means the last part of the URL path.

Mixtures of the two methods can also occur in which the ID is retained but readable words are added. In this case the ID is the decisive characteristic of the URL and the words can be changed or omitted.

In practice it is usually desired that URLs from the web browser can be saved as bookmarks and called up again at any later time. They should also be passed on to third parties and can be called up by them and trigger the same action or create the same state (e.g. carry out a search).

Examples

An example of both clean and speaking URLs is Wikipedia , whose URLs are structured according to the following scheme:

<Protokoll><Sprachcode>.wikipedia.org/wiki/<Artikelbezeichnung>

For example, the URL for the term sunflower looks like this

https://de.wikipedia.org/wiki/Sonnenblume

instead of a URL that allows conclusions to be drawn about the technology

https://de.wikipedia.org/w/index.php?title=Sonnenblume

or a URL that gives no indication of the content

https://de.wikipedia.org/?curid=112763

(all given URLs have the same result)

technology

Clean URLs can be implemented at the web server and web application level. However, the web server must also be configured accordingly at the web application level.

Web server level

Most web servers such as Apache HTTP Server or nginx can implement "clean" URLs with the help of .htaccess or with rewrite engines . These modules allow queries to be rewritten or reinterpreted internally on the basis of previously defined rules using regular expressions . For example, the query from could foo/barachieve the same result as the query from /index.php?q=/foo/bar. The CGI protocol offers another technique, in which case a script is called /index.php/foo/bar /foo/baras PATH_INFO.

Web application level

Some web content management systems already contain suitable rewrite rules, making them very easy to activate.

advantages

  • Users can rate the relevance of speaking URLs faster (a meaningful URL is usually more clicked on than a cryptic one).
  • Users can remember the URLs more easily (and similar file extensions such as html or htm no longer need to be guessed).
  • External links and bookmarks on a page are valid for much longer because they are independent of internal technical changes.
  • In the search engine optimization (there sefURL for search engine friendly ) are in the search engine ranking of keywords rated next to the page content and domain and file names of individual pages.

Web links

Individual evidence

  1. RFC1738: Uniform Resource Locators (URL) . 3.3. HTTP (English)
  2. RFC3986: Uniform Resource Identifier (URI): Generic Syntax . 3. Syntax Components (English)
  3. Jakob Nielsen: URL as UI. Nielsen Norman Group, March 21, 1999, accessed April 6, 2013 .
  4. RFC 3875 - The Common Gateway Interface (CGI) Version 1.1 . (English)
  5. Tim Berners-Lee : Cool URIs don't change. World Wide Web Consortium , 1998, accessed April 10, 2013 .
  6. Sefurl - Search Engine Friendly Uniform Resource Locator. Why Sefurl? In: sefurl.de. Retrieved on June 12, 2011 : "However, keywords are also evaluated in the domain name and in the file name of the individual pages."