When a Visualforce page is redirected using the Apex setRedirect() method on a PageReference object, the HTTP response code returned is 200 (OK) rather than a 3XX redirect status code (such as 301 Moved Permanently or 302 Found). Developers who check the HTTP status code to confirm that a redirect has occurred may be confused by this behavior.
This behavior is expected and is by design. The setRedirect() method in Salesforce Apex performs a server-side forward, not a server-side redirect. The distinction is important:
When setRedirect(true) is called in an Apex controller, Salesforce performs this server-side forward. The forwarded request is handled by the target page on the same server, and the result is returned to the client as a 200 response.
Example scenario: If you call setRedirect(true) in an Apex controller and inspect the browser's Network tab using Chrome DevTools, you will see a 200 response for the page navigation — not a 301 or 302. This is correct behavior.
000383215

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.