---
schema_version: "1"
id: 5753578b29f7b119d89682ee34e7756cd0e265ddb04501743065a772d18edf0e
title: getRedirect()
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_System_PageReference_getRedirect.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_PageReference_getRedirect.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 864c85f56dc025f2a31b87baab438833583a16c103600b0032bb5940e4beed7d
description: Returns the current value of the PageReference object's redirect attribute.
---
# getRedirect()

Returns the current value of the PageReference object's redirect attribute.

## Signature

public Boolean getRedirect()

## Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

## Usage

Note that if the URL of the PageReference object is set to a website outside of the salesforce.com domain, the redirect always occurs, regardless of whether the redirect attribute is set to true or false.