Rewrite rules modify part or all of the URL path in the user's request. usually for one of two purposes:
Inform browsers that the resource they're requesting is now in a different location. When your website's domain name has changed, when you want customers to use a canonical URL format (with or without the www prefix), and when you want to detect and correct common spelling errors in your domain name. The return and rewrite directives are ideal for these situations.
To control the processing flow within the reverse-proxy. Example: To forward requests to an application server when content needs to be dynamically generated.
The request field expresses the request that will arrive at the reverse-proxy before being processed. This means that the path may not exist on your web server. For example, let's say that the urls /downloads, /dowanlad, /downlaod (with a bad spelling) must be understood by the real URL /download.php
There are 3 ways to represent these 3 source urls in this section
Create 3 rules: one for /downloads, one for /dowanlad, one for /downlaod
Use a single rule with a regular expression (if you're familiar with it) eg “^/(downloads|dowanlad|downlaod)”
Use a single rule using list: as prefix and values speparated by a comma eg list:/downloads,/dowanlad,/downlaod
This is the destination of the request, the one that must actually exist on your Web server. If you're using a regular expression with groups, then it's possible to specify the group result with a dollar followed by the number corresponding to the group ($1, $2, $3...).
Start at the new calculated location: This is the most common option, it stops current processing and starts the search for a new location corresponding to the modified URI, so you can specify a defined path , for example.
Stop rules processing: stops processing the current set ( similar to 1 but continues applies next other settings)
Permanent redirection: Return a 301 code and ask the browser to return back with the correct uri.
Temporary redirection: Return a 302 code and ask the browser to return back with the correct uri.