||It has been suggested that Clean URL be merged into this article. (Discuss) Proposed since August 2012.|
The term semantic URL refers to a URL which is of a form that is immediately and intuitively meaningful to non-experts. Such URL schemes tend to reflect the conceptual structure of a collection of information (see Information Architecture) and decouple the user interface from a server's internal representation of information. Semantic URLs have become an issue in recent years with the increasing use of server-side scripting to power web sites and web services.
The key issue with non-semantic URL is that while the query string parameters can be manipulated by hand, it is not always obvious what their possible values are. For example, many content management systems use a database record number to specify the page. This has a logical meaning only to the database management system, meaning page URLs cannot be inferred by users.
Also, if the site database is moved/restructured, or the site itself is ported to a different software, all of its URLs can change, due to database records being re-ordered, script file names and/or extensions being changed, and so on. This can cause numerous problems, such as broken links (both internally and from external sites) and removal of search engine listings.
How a semantic URL works
A semantic URL replaces long query strings with a simple, traditional path structure. For example, the URL shown above could be replaced with the following:
The implementation of this can vary, but most often involves transparently rewriting the semantic URL into the query string form which is understood by the server-side software. Because the rewriting takes place on the server side, the semantic URL is the only form seen by the user.
Semantic URLs typically have the following qualities:
- are easily remembered,
- indicate navigational structure and position,
- are intuitively manipulated,
- are more durable and more reliably bookmarked, and
- may inadvertently improve security by hiding internal server or application information.