1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

add a note on rewrite middleware for local URL modifications

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-29 18:15:22 +03:00
parent 07f07ecf6c
commit a3279b8fa9
2 changed files with 3 additions and 2 deletions

View File

@@ -31,7 +31,8 @@ func main() {
// http://localhost:8080/docs/v12some -> http://localhost:8080/docs // http://localhost:8080/docs/v12some -> http://localhost:8080/docs
// http://localhost:8080/oldsome -> http://localhost:8080 // http://localhost:8080/oldsome -> http://localhost:8080
// http://localhost:8080/oldindex/random -> http://localhost:8080 // http://localhost:8080/oldindex/random -> http://localhost:8080
// http://localhost:8080/users.json -> http://localhost:8080/users?format=json // http://localhost:8080/users.json -> http://localhost:8080/users.json
// ^ (but with an internal ?format=json, client can't see it)
app.Listen(":8080") app.Listen(":8080")
} }

View File

@@ -12,7 +12,7 @@ RedirectMatch: # REDIRECT_CODE_DIGITS | PATTERN_REGEX | TARGET_REPL
- 301 ^(http|https)://test.(.*) $1://newtest.$2 - 301 ^(http|https)://test.(.*) $1://newtest.$2
# Handles /*.json or .xml as *?format=json or xml, # Handles /*.json or .xml as *?format=json or xml,
# without redirect. See /users route. # WITHOUT redirect. See /users route.
# When Code is 0 then it does not redirect the request, # When Code is 0 then it does not redirect the request,
# instead it changes the request URL # instead it changes the request URL
# and leaves a route handle the request. # and leaves a route handle the request.