Rewrite Engine

A rewrite engine is a software component that performs rewriting on Uniform Resource Locators, modifying their appearance. This modification is called URL rewriting. It is a way of implementing URL mapping or routing within a web application.
The engine is typically a component of a web server or web application framework. Rewritten URLs (sometimes known as short, pretty or fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a layer of abstraction between the files used to generate a web page and the URL that is presented to the outside world.

Usageof URL rewriting

Web sites with dynamic content can 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:

but can be rewritten as:

A blog might have a URL that encodes the dates of each entry:

It can be altered like this:

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:

A site can pass specialized terms from the URL to its search engine as a search term. This would allow users to search directly from their browser. For example, the URL as entered into the browser's location bar: term

Will be urlencoded by the browser before it makes the HTTP request. The server could rewrite this to:

Benefits and drawbacks of URL rewriting

There are several benefits to using URL rewriting:

● The links are "cleaner" and more descriptive, improving their "friendliness" to both users and search engines.
● They prevent undesired "inline linking", which can waste bandwidth.
● The site can continue to use the same URLs even if the underlying technology used to serve them is changed.

There can, however be drawbacks as well; if a user wants to modify a URL to retrieve new data, URL rewriting 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:

In this case, the original query string was more useful, since the query variables indicated month and day:

Web frameworks

Many web frameworks include URL rewriting, either directly or through extension modules.

● Apache HTTP Server has URL rewriting provided by the mod_rewrite module.
● URL Rewrite is available as an extension to Microsoft IIS.
● Ruby on Rails has built-in URL rewriting via Routes.
● Java, and Servlet/Java EE have extendable URL rewriting via the OCPsoft URLRewriteFilter and Tuckey UrlRewriteFilter.
● Java Server Faces, Java EE, and Servlet have simplified URL rewriting via the PrettyFaces: URLRewriteFilter.
● Django uses a regular-expressions based system. This is not strictly URL rewriting since there is no script to 'rewrite' to, nor even a directory structure; but it provides the full flexibility of URL rewriting.
● Java Stripes Framework has had integrated functionality since version 1.5.
M● any Perl frameworks, such as Mojolicious and Catalyst, have this feature.
● CodeIgniter has URL rewriting provided.
● lighttpd has a mod_rewrite module.
● Hiawatha HTTP server has a URL Toolkit which supports URL rewriting.
● Cherokee HTTP server supports regular expressions of URL rewriting and redirections.

From a software development perspective, URL rewriting can aid in code modularization and control flow, making it a useful feature of modern web frameworks.

References By: oracle | wikipedia « Privious Post » « Next Post » share on :        :  

Love to hear your Views / Guidance / Recommendations on this Post…

Explore the Technology World

Computer Programming Terminologies Computer Programming Terminology is a general word for the group of specialized words or meanings relating to Computer Programming, and also the study of such t ...Read MoreNew features in JDK 12 with IntelliJ IDEADeveloped by JetBrains (formerly known as IntelliJ) ,IntelliJ IDEA is a Java integrated development environment (IDE) for developing computer software. It is av ...Read MoreGoogle Pay API Implementation Demo for AndroidIn this youtube Channel by Android Developers ,Learn how to implement the Google Pay API for Android with just a few lines of code and how it works with your ex ...Read MoreUnit Testing in .NET Core and Azure Devops pipelineUnit testing is a software testing method by which individual units of source code, usage procedures,sets of one or more computer program modules together with ...Read MoreThe mind behind Linux & GIT : Linus TorvaldsLinus Torvalds transformed technology twice — first with the Linux kernel, which helps power the Internet, and again with Git, the source code management ...Read MoreTensorflow and deep learningWith Tensorflow ,deep machine learning transitions from an area of research into mainstream software engineering. ...Read MoreJava program to return all possible permutations from collection of distinct numbersexample of Java program to return all possible permutations from collection of distinct numbers ...Read MoreReal Time Analytics with Spring Application Development FrameworkSpring is the most popular application development framework for enterprise Java.Millions of developers use Spring to build simple, truly portable, fast and fle ...Read MorePath Setting in Java When an application is launched from command prompt Windows OS searches for the executable program in the current working directory. The prompt throws an error ...Read MoreFacebook | whatsapp|Github | Twitter | LinkedIn | Youtube| reddit About | Cookies-Policy | Disclaimer | Site Map | Contact

Call / Visit for New Batch


Why Join Us

  • ➯ Free Demo Classes
  • ➯ No Registration Fee
  • ➯ Interview Questions
  • ➯ Study Materials
  • ➯ Softwares
  • ➯ Aptitude & Reasoning
  • ➯ Placement Assitance


  • MyJava Training Institute ,
  • Plot No.243 , shop No 14 ,
  • Secnd Floor , Zone-II ,
  • M.P.Nagar , Bhopal,
  • Madhya Pradesh ( 462011 )
  • ☎  08871209400 , 7987028543
  • 🌐
FacebookGoogle +TwitterYouTube

MyJava - java Training Institute