function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
iainfarqiainfarq 

Custom URL reverts to original site domain after some actions

We are using custom URL with Sites and for certain actions we see the URL revert to the original site domain.

 

An example of where everything woks fine and custom URL is not affected:

 

PageReference page = new PageReference(System.Page.SiteApplication.getUrl()+linkUtil.mandatoryParams+'&candidateId='+candidateId+'&jobId='+jobId);
        page.setRedirect(true);
        return page;

 

An example of where we perform an action and custom URL reverts back to original site domain:

 

PageReference pr; pr = new PageReference(System.Page.login.getUrl()+linkUtil.mandatoryParams+'&jobId='+jobId);
pr.setRedirect(true);
     return pr;

 

Does anyone know what might be causing this?

 

Cheers.

RyanGuestRyanGuest

Login is a special case.

 

You can't do a POST of username and password to anything other than your secure web address. That's why it's always returning the force.com address and not the custom web URL.