# Linking to Account Portal pages

## Redirect URL

If a user accesses an Account Portal page _directly_, the `redirect_url` query param will not be present, so the user cannot be redirected back to your application once they are finished with their Account Portal flow. To prevent this, it is recommended that you always specify the redirect in the link when sharing it.

You can use the following format for your direct links:

`https://accounts.<your-domain.com>/<account-portal-page>?redirect_url=<your-redirect-url>`

**Example**

`https://accounts.myapp.com/sign-in?redirect_url=https://myapp.com/dashboard`

The domain is `myapp.com`, the user is being linked to the sign-in Account Portal page at `https://accounts.myapp.com/sign-in` and they will be redirected to `https://myapp.com/dashboard` after they are signed in.

> The `redirect_url` value must be a URL on your instance's domain or one of its subdomains, or share the same origin as the requesting page (which is why `localhost` works in development).

## Fallback redirects

If a user visits an Account Portal page directly without a `redirect_url` query param, you can configure a fallback redirect so they're still sent to the right place after they complete their flow.

In the Clerk Dashboard, navigate to the [**Account Portal**](https://dashboard.clerk.com/~/account-portal?tab=redirects) page and open the **Redirects** tab to set the fallback redirect URLs for sign-in, sign-up, and other Account Portal flows.

If you use self-hosted Clerk components instead of the Account Portal, see [Customize your redirect URLs](https://clerk.com/docs/guides/development/customize-redirect-urls.md) to configure redirects with environment variables or component props.

## Prefill sign in and sign up fields

In the case of direct links, the values to be used for prefilling the fields for sign-in or sign-up can be specified via the following query parameters:

- `email_address`
- `phone_number`
- `username`
- `first_name`
- `last_name`

For example, visiting `https://accounts.example.com/sign-in?username=nick` will result in the username field being prefilled with the value `nick`.

---

## Sitemap

[Overview of all docs pages](https://clerk.com/docs/llms.txt)
