mirror of https://github.com/vapor/docs.git
Update routing.md (#920)
This commit is contained in:
parent
3fa1e50c1d
commit
fbd9723a00
|
|
@ -383,7 +383,7 @@ Für eine Weiterleitung kann es verschiedenste Gründe geben. Mit der Methode *r
|
||||||
req.redirect(to: "/some/new/path")
|
req.redirect(to: "/some/new/path")
|
||||||
|
|
||||||
/// redirect a page permanently
|
/// redirect a page permanently
|
||||||
req.redirect(to: "/some/new/path", type: .permanent)
|
req.redirect(to: "/some/new/path", redirectType: .permanent)
|
||||||
```
|
```
|
||||||
|
|
||||||
Es gibt verschiedene Arten von Weiterleitungen:
|
Es gibt verschiedene Arten von Weiterleitungen:
|
||||||
|
|
|
||||||
|
|
@ -424,10 +424,10 @@ req.redirect(to: "/some/new/path")
|
||||||
También puedes especificar el tipo de redirección, por ejemplo para redirigir una página de forma permanente (para que su SEO se actualice correctamente) usa:
|
También puedes especificar el tipo de redirección, por ejemplo para redirigir una página de forma permanente (para que su SEO se actualice correctamente) usa:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
req.redirect(to: "/some/new/path", type: .permanent)
|
req.redirect(to: "/some/new/path", redirectType: .permanent)
|
||||||
```
|
```
|
||||||
|
|
||||||
Los diferentes `RedirectType` son:
|
Los diferentes `Redirect` son:
|
||||||
|
|
||||||
* `.permanent` - devuelve una redirección **301 Moved Permanently**
|
* `.permanent` - devuelve una redirección **301 Moved Permanently**
|
||||||
* `.normal` - devuelve una redirección **303 See Other**. Este es el valor por defecto de Vapor y le dice al cliente que siga la redirección con una petición **GET**.
|
* `.normal` - devuelve una redirección **303 See Other**. Este es el valor por defecto de Vapor y le dice al cliente que siga la redirección con una petición **GET**.
|
||||||
|
|
|
||||||
|
|
@ -424,10 +424,10 @@ req.redirect(to: "/some/new/path")
|
||||||
You can also specify the type of redirect, for example to redirect a page permanently (so that your SEO is updated correctly) use:
|
You can also specify the type of redirect, for example to redirect a page permanently (so that your SEO is updated correctly) use:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
req.redirect(to: "/some/new/path", type: .permanent)
|
req.redirect(to: "/some/new/path", redirectType: .permanent)
|
||||||
```
|
```
|
||||||
|
|
||||||
The different `RedirectType`s are:
|
The different `Redirect`s are:
|
||||||
|
|
||||||
* `.permanent` - returns a **301 Permanent** redirect
|
* `.permanent` - returns a **301 Permanent** redirect
|
||||||
* `.normal` - returns a **303 see other** redirect. This is the default by Vapor and tells the client to follow the redirect with a **GET** request.
|
* `.normal` - returns a **303 see other** redirect. This is the default by Vapor and tells the client to follow the redirect with a **GET** request.
|
||||||
|
|
|
||||||
|
|
@ -423,10 +423,10 @@ req.redirect(to: "/some/new/path")
|
||||||
U kunt ook het type omleiding specificeren, bijvoorbeeld om een pagina permanent om te leiden (zodat uw SEO correct wordt bijgewerkt) gebruiken we:
|
U kunt ook het type omleiding specificeren, bijvoorbeeld om een pagina permanent om te leiden (zodat uw SEO correct wordt bijgewerkt) gebruiken we:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
req.redirect(to: "/some/new/path", type: .permanent)
|
req.redirect(to: "/some/new/path", redirectType: .permanent)
|
||||||
```
|
```
|
||||||
|
|
||||||
De verschillende `RedirectType`s zijn:
|
De verschillende `Redirect`s zijn:
|
||||||
|
|
||||||
* `.permanent` - geeft een **301 Permanent** omleiding.
|
* `.permanent` - geeft een **301 Permanent** omleiding.
|
||||||
* `.normal` - retourneert een **303 see other** redirect. Dit is de standaard door Vapor en vertelt de client om de omleiding te volgen met een **GET** verzoek.
|
* `.normal` - retourneert een **303 see other** redirect. Dit is de standaard door Vapor en vertelt de client om de omleiding te volgen met een **GET** verzoek.
|
||||||
|
|
|
||||||
|
|
@ -432,10 +432,10 @@ req.redirect(to: "/some/new/path")
|
||||||
你可以设置重定向的类型,比如说永久的重定向一个页面(来使你的 SEO 正确的更新),请使用:
|
你可以设置重定向的类型,比如说永久的重定向一个页面(来使你的 SEO 正确的更新),请使用:
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
req.redirect(to: "/some/new/path", type: .permanent)
|
req.redirect(to: "/some/new/path", redirectType: .permanent)
|
||||||
```
|
```
|
||||||
|
|
||||||
不同的 `RedirectType` 有:
|
不同的 `Redirect` 有:
|
||||||
|
|
||||||
* `.permanent` - 返回一个 **301 Permanent** 重定向。
|
* `.permanent` - 返回一个 **301 Permanent** 重定向。
|
||||||
* `.normal` - 返回一个 **303 see other** 重定向。这是 Vapor 的默认行为,来告诉客户端去使用一个 **GET** 请求来重定向。
|
* `.normal` - 返回一个 **303 see other** 重定向。这是 Vapor 的默认行为,来告诉客户端去使用一个 **GET** 请求来重定向。
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue