`navigateTo` is available on both server side and client side. It can be used within plugins, middleware or can be called directly to perform page navigation.
`to` can be a plain string or a route object to redirect to. When passed as `undefined` or `null`, it will default to `'/'`.
### `options` (optional)
**Type**: `NavigateToOptions`
An object accepting the following properties:
-`replace` (optional)
**Type**: `boolean`
**Default**: `false`
By default, `navigateTo` pushes the given route into the Vue Router's instance on the client side.
This behavior can be changed by setting `replace` to `true`, to indicate that given route should be replaced.
-`redirectCode` (optional)
**Type**: `number`
**Default**: `302`
`navigateTo` redirects to the given path and sets the redirect code to [`302 Found`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) by default when the redirection takes place on the server side.
This default behavior can be modified by providing different `redirectCode`. Commonly, [`301 Moved Permanently`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301) can be used for permanent redirections.
-`external` (optional)
**Type**: `boolean`
**Default**: `false`
Allows navigating to an external URL when set to `true`. Otherwise, `navigateTo` will throw an error, as external navigation is not allowed by default.