I have a community setup and recently added a custom url to move from the sitea.force.com url schema to our own domain of ourdomain.org.

For instance, I added the new custom domain of siteb.ourdomain.org and the community is accessible at that address. I want to redirect all users coming in to sitea.force.com to the new URL at siteb.ourdomain.org. How can I do this? The site redirect rules won't quite do this. Any ideas?


You can do a javascript redirect.

For a Visual Force community, create the following Visual Force page and set it as the home page:


For a lightning community, create the following component and put it on the home page:

the lightning component

  <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>    

the lightning client side controller

   doInit: function(cmp) {

For the above examples, you replace the url with your own custom url.

| improve this answer | |
  • I just saw this. This is exactly what I ended up doing yesterday. I just stuck the code in an existing component, though. Not what I really wanted to do, as I figured there was a better way to do it, but it works. – Tony Evans May 2 '18 at 23:29

You can create Login flow and attached the flow in the user's profile. Refer Set Up a Login Flow and Connect to Profiles

In the LoginFlow_FinishLocation variable, specify your new URL siteb.ourdomain.org.

It should work.

For more information, refer Login flow examples

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.