This can be done with the help of an invisible lightning component on the record page.
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:handler name="change" value="{!v.simpleRecord}" action="{!c.onChange}"/>
<aura:attribute name="record" type="Object" />
<aura:attribute name="simpleRecord" type="Object" />
<aura:attribute name="recordError" type="String" />
<force:recordData aura:id="recordHandler"
fields="IsPrivate"
recordId="{!v.recordId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields ="{!v.simpleRecord}"/>
</aura:component>
Controller
onChange : function(component, event, helper) {
console.log('on change...');
var urlEvent = $A.get("e.force:navigateToURL"); //Redirect from here
urlEvent.setParams({
"url": "/006/o"
});
}
Go ahead and drop this component on the record page of any object. You will be redirected to the given URL in case of any change.
Please note that we can add any conditional statement in the 'onChange' function of the controller.