> For the complete documentation index, see [llms.txt](https://docs.elentra.org/ejs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elentra.org/ejs/1.3/guide/plugins/core-plugins/instance-methods/usdredirectto.md).

# $redirectTo

## Introduction

`$redirectTo(string routeName, Object routeArgs = {}) : void`

The **$redirectTo** instance method accepts a [route](/ejs/1.3/guide/routing/routes.md) name and its expected [parameters](/ejs/1.3/guide/routing/routes.md#parameters).  It will generate the appropriate path and redirect the user.

{% hint style="info" %}
Always prefer **$redirectTo** over [$generatePath](/ejs/1.3/guide/plugins/core-plugins/instance-methods/usdgeneratepath.md) as it abstracts the way in which the redirect is handled, allowing it to be easily changed in the future.
{% endhint %}
