Consider that there is an org (using Salesforce Classic) where I've configured a Home Page Custom Component of type Visualforce Area – in which there is a visualforce page that does nothing but automatically redirects users to another visualforce page (let's say, a front page with custom style & useful links). I've added that custom component to the Home Page Layout and assigned it to the users.
Per my understanding, the classic redirect in force.com can be implemented with a combination of a visualforce page and controller:
public with sharing class redirect_controller {
public PageReference redirect() {
PageReference pageref = Page.customFrontPage;
pageref.setRedirect(True);
return pageref;
}
}
<apex:page applyHtmlTag="false"
applyBodyTag="false"
showHeader="false"
showChat="false"
sidebar="false"
standardStylesheets="false"
controller="redirect_controller"
action="{!redirect}" >
</apex:page>
But the given code doesn't do the job I need. It only updates the contents of the Custom Home Page Component – I would hope that it would redirect user from the Home Page entirely, but no, oh well.
As dirty hack, the following code works, but it is against the best practices, and it is not a viable option, since the redirect gets blocked in Chrome Canary:
<apex:page applyHtmlTag="false"
applyBodyTag="false"
showHeader="false"
showChat="false"
sidebar="false"
standardStylesheets="false">
<script type="text/javascript">
top.location.href = '/apex/customFrontPage';
</script>
</apex:page>
Still trying to figure out the proper way to redirect users from Home Page to another visualforce page without violating the same-origin policy.