---
title: Redirects
description: Learn how redirect URLs in Expo Router.
hideTOC: true
---
You can redirect a request to a different URL based on some in-app criteria. Expo Router supports a number of different redirection patterns.
## Redirect
You can immediately redirect from a particular screen by using the `Redirect` component:
```jsx
import { View, Text } from 'react-native';
/* @info */
import { Redirect } from 'expo-router';
/* @end */
export default function Page() {
/* @info Some logic to determine if the user is logged in. */
const { user } = useAuth();
/* @end */
if (!user) {
/* @info Redirect to the login screen if the user is not authenticated. */
return ;
/* @end */
}
return (
Welcome Back!
);
}
```
You can also redirect imperatively with the `useRouter` hook:
```jsx
import { Text } from 'react-native';
import { useRouter, useFocusEffect } from 'expo-router';
function MyScreen() {
const router = useRouter();
useFocusEffect(() => {
// Call the replace method to redirect to a new route without adding to the history.
// We do this in a useFocusEffect to ensure the redirect happens every time the screen
// is focused.
router.replace('/profile/settings');
});
return My Screen;
}
```