Clean URL

Short description: URL intended to improve the usability of a website

Clean URLs (also known as user-friendly URLs, pretty URLs, search-engine–friendly URLs or RESTful URLs) are web addresses or Uniform Resource Locators (URLs) intended to improve the usability and accessibility of a website, web application, or web service by being immediately and intuitively meaningful to non-expert users. Such URL schemes tend to reflect the conceptual structure of a collection of information and decouple the user interface from 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 allows more durable and reliable bookmarking of web resources.[2]

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 server-side script, such as example.php, example.asp or cgi-bin. If the underlying implementation of a resource is changed, such URLs would need to change along with it. Likewise, when URLs are not "clean", if the site database 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 clean URLs presents a consistent location for resources to user agents regardless 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 security of a system.[1]

## Contents

* 1 Structure
* 2 Implementation
* 2.1 Slug
* 3 See also
* 4 References
* 5 External links

## Structure

This section does not cite any external source. HandWiki requires at least one external source. See citing external sources. Please help improve this section. Unsourced material may be removed in future.
Find sources: "Clean URL" – news · newspapers · books · scholar · JSTOR (March 2025) (Learn how and when to remove this template message)

|

A URL will often comprise a path, script name, and query string. The query string parameters dictate the content to show on the page, and frequently include information opaque or irrelevant to users—such as internal numeric identifiers for values in a database, illegibly encoded data, session IDs, implementation details, and so on. Clean URLs, by contrast, contain only the path of a resource,[3][4] in a hierarchy that reflects some logical structure that users can easily interpret and manipulate.

Original URL | Clean URL

|

`http://example.com/about.html` | `http://example.com/about`
`http://example.com/user.php?id=1` | `http://example.com/user/1`
`http://example.com/index.php?page=name` | `http://example.com/name`
`http://example.com/kb/index.php?cat=1&id=23` | `http://example.com/kb/1/23`
`http:https://handwiki.org/wiki/index.php?title=Clean_URL` | `http:https://handwiki.org/wiki/Clean_URL`

## Implementation

The implementation of clean URLs involves URL mapping via pattern matching or transparent rewriting techniques. As this usually takes place on the server side, the clean URL is often the only form seen by the user.

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 articles and conjunctions, while descriptive keywords are added to increase user-friendliness and improve search engine rankings.[1]

A fragment identifier can be included at the end of a clean URL for references within a page, and need not be user-readable.REFERENCE FOR RFC3986 IS NOT DEFINED YET. You are invited to add it here.

### Slug

A URL slug is usually the end part of the URL, especifically the part "path/pathinfo", which can be interpreted as the name of the resource (similar to the basename in a filename or the title of a webpage). It is often described as the part of a URL that identifies a page in human-readable keywords,[5][6] while others use a broader definition emphasizing that legible slugs are more user-friendly.[7][8] The name slug is based on the usage by the news media to indicate a short name given to an article for internal use.[9]

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 a rough idea of the page's topic. Long page titles may also be truncated to keep the final URL to a reasonable length.

Slugs may be entirely lowercase, with accented characters replaced by letters from the Latin script and whitespace characters replaced by a hyphen or an underscore to avoid being encoded. Punctuation marks are generally removed, and some also remove short, common words such as conjunctions. For example, the title This, That, and the Other! An Outré Collection could have a generated slug of `this-that-other-outre-collection`.

Another benefit of URL slugs is the facilitated ability to find a desired page from a long list of URLs without page titles, such as a minimal list of opened tabs exported using a browser extension, and the ability to preview the approximate title of a target page in the browser if hyperlinked without title.

If a tool to save web pages locally uses the string after the last slash as the default file name, like wget does, a slug makes the file name more descriptive.

Websites that make use of slugs include Stack Exchange Network with question title after slash, and Instagram with `?taken-by=username` URL parameter.[10][11]

## See also

* Information architecture
* Permalink
* Persistent uniform resource locator (PURL)
* URL normalization
* URL redirection
* URL shortening
* HTTP referer § Referrer hiding
* Canonical link element

## References

1. ↑ 1.0 1.1 1.2 Opitz, Pascal (28 February 2006). "Clean URLs for better search engine ranking". Content with Style. http://www.contentwithstyle.co.uk/content/clean-urls-for-a-better-search-engine-ranking.
2. ↑ Berners-Lee, Tim (1998). "Cool URIs don't change". Style Guide for online hypertext. W3C. http://www.w3.org/Provider/Style/URI.html.
3. ↑ Ayers, Danny; Völkel, Max (3 December 2008). "Cool URIs for the Semantic Web". https://www.w3.org/TR/cooluris/.
4. ↑ "Clean URLs" (in en). https://www.hacksplaining.com/glossary/clean-urls.
5. ↑ "WordPress Glossary". 18 November 2018. https://wordpress.org/documentation/article/wordpress-glossary/.
6. ↑ "Glossary | Django documentation". https://docs.djangoproject.com/en/dev/glossary/.
7. ↑ Pavlik, Vlado (20 Aug 2024). "What Is a Slug? URL Slugs and Why They Matter for SEO". https://www.semrush.com/blog/what-is-a-url-slug/.
8. ↑ "Slug - Glossary | MDN". 11 July 2025. https://developer.mozilla.org/en-US/docs/Glossary/Slug.
9. ↑ Davey, Lizzy (January 15, 2024). "What is a URL Slug? 9 Best Practices for SEO". in Matherson, Nate. https://www.positional.com/blog/slug.
10. ↑ "Question URL slugs based on title". 10 October 2011. https://meta.stackexchange.com/questions/108949/question-url-slugs-based-on-title.
11. ↑ "16 Best Instagram Tricks And Hidden Features You Must Know". 4 August 2017. https://fossbytes.com/best-instagram-tricks-hidden-features/.

## External links

* Jakob, Nielsen (20 March 1999). "URL as UI". https://www.nngroup.com/articles/url-as-ui/.
* Hoffman, Paul E. (28 April 1995). "The User Interface of URLs". http://www.isoc.org/inet95/proceedings/PAPER/016/html/paper.html.
* Berners-Lee, Tim (1998). "Cool URIs don't change". https://www.w3.org/Provider/Style/URI.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Clean URL. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Clean_URL&oldid=4226330"