|
|
It has been suggested that this article or section be merged into Clean URL. (Discuss) Proposed since April 2012. |
| This article relies on references to primary sources or sources affiliated with the subject, rather than references from independent authors and third-party publications. Please add citations from reliable sources. (January 2011) |
|
|
This article's use of external links may not follow Wikipedia's policies or guidelines. Please improve this article by removing excessive or inappropriate external links, and converting useful links where appropriate into footnote references. (January 2011) |
A rewrite engine is software located in a Web application framework running on a Web server that modifies a web URL's appearance. This modification is called URL rewriting. Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly - SEF) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the outside world.
|
Contents
|
Websites with dynamic content use URLs that generate pages from the server using query string parameters. These are often rewritten to resemble URLs for static pages on a site with a subdirectory hierarchy. For example, the URL to a wiki page might be:
http://example.com/wiki/index.php?title=Page_title
but can be rewritten as:
http://example.com/wiki/Page_title
A blog might have a URL that encodes the dates of each entry:
http://www.example.com/Blog/Posts.php?Year=2006&Month=12&Day=19
It can be altered like this:
http://www.example.com/Blog/2006/12/19/
which also allows the user to change the URL to see all postings available in December, simply by removing the text encoding the day '19', as though navigating "up" a directory:
http://www.example.com/Blog/2006/12/
There are several benefits to using a rewrite engine for URLs[1]:
There can, however be drawbacks as well; if a user wants to modify a URL to retrieve new data, the rewrite engine may hinder the construction of custom queries due to the lack of named variables. For example, it may be difficult to determine the date from the following format:
http://www.example.com/Blog/06/04/02/
In this case, the original query string was more useful, since the query variables indicated month and day:
http://www.example.com/Blog/Posts.php?Year=2006&Month=04&Day=02
Many web frameworks include URL rewriting, either directly or through extension modules.
From a software development perspective, URL rewriting can aid in code modularization and control flow,[10] making it a useful feature of modern web frameworks.
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)