I have a very similar setup to this question: How do I use a custom URL for the Customer Portal
I first access my site through a custom url. I see the login page because that is the active page I set for the site. When I login the browser goes to the front door url, as I can see in the browser history, and then sends me back to my Visual Force login page.
From there, to see if I logged in, I can type in the URL of the portal page I want to go (myportalurl.com/home/home.jsp) and I am authorized. I tried setting my startURL parameter to /home/home.jsp but it still sends me back to my site's Active Home Page where I setup my custom login visual force page.
Is there something obvious I am missing?
Here is the controller:
/**
* An apex page controller that exposes the site login functionality
*/
global with sharing class LoginController {
global String username {get; set;}
global String password {get; set;}
global PageReference login() {
return Site.login(username, password, '/home/home.jsp');
}
global LoginController () {}
@IsTest(SeeAllData=true) global static void testLoginController () {
// Instantiate a new controller with all parameters in the page
SiteLoginController controller = new SiteLoginController ();
controller.username = '[email protected]';
controller.password = '123456';
System.assertEquals(controller.login(),null);
}
}