+ Start a Discussion

How to prevent redirect loop when overriding View?

I have a VisualForce page, and want to override Account detail, but only in some circumstances (otherwise default to the standard salesforce view detail page).
When I override the "View" button with this VF page, the following code does redirect to the standard page, but it creates an infinite redirect loop.
How do I redirect from a VF page to a standard page and prevent the loop? Adding "&sfdc.override=1" to /id in routePage produces "URL no longer exists" error.

showHeader="true" tabStyle="account"
action="{!routePage}" >



public PageReference routePage() {
return new PageReference( '/' + acct.id );


Best Answer chosen by Admin (Salesforce Developers) 

Try setting the url to


'/' + act.Id +  '?nooverride=1';