Slug (web publishing)
Encyclopedia
A slug is the part of a URL which identifies a page using human-readable keywords , for example "Slug_(web_publishing)", rather than an opaque identifier such as the ID number of the content within the database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

 (e.g. "4859604"). Slugs are used to construct clean URLs (often for permalink
Permalink
A permalink is a URL that points to a specific blog or forum entry after it has passed from the front page to the archives. Because a permalink remains unchanged indefinitely, it is less susceptible to link rot. Most modern weblogging and content-syndication software systems support such links...

s) that are easy to type, descriptive, and easy to remember.

For example, in this URL:

http://example.org/2011/introduction-to-blogging


the slug is "introduction-to-blogging".

Typically, slugs are generated from a human-readable phrase such as the title of a news article, blog
Blog
A blog is a type of website or part of a website supposed to be updated with new content from time to time. Blogs are usually maintained by an individual with regular entries of commentary, descriptions of events, or other material such as graphics or video. Entries are commonly displayed in...

 post, or encyclopedia entry. It is also common practice to make the slug all lowercase and to remove non-essential words, such as conjunctions and articles
Article (grammar)
An article is a word that combines with a noun to indicate the type of reference being made by the noun. Articles specify the grammatical definiteness of the noun, in some languages extending to volume or numerical scope. The articles in the English language are the and a/an, and some...

, to shorten the final URL. Long page titles may also be truncated to keep the URL a reasonable length.

To make the URL easier for users to type, special characters are often removed or replaced as well. For instance, accented characters are usually replaced by letters from the English alphabet
English alphabet
The modern English alphabet is a Latin alphabet consisting of 26 letters and 2 ligatures – the same letters that are found in the Basic modern Latin alphabet:...

; punctuation marks are generally removed; and spaces (which have to be encoded as %20 or +) are replaced by dash
Dash
A dash is one of several kinds of punctuation mark. Dashes appear similar to hyphens, but differ from them primarily in length, and serve different functions. The most common versions of the dash are the en dash and the em dash .-Common dashes:...

es (-) or underscore
Underscore
The underscore [ _ ] is a character that originally appeared on the typewriter and was primarily used to underline words...

s (_), which are more aesthetically pleasing.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK