We set up communities in our system to differentiate between regions. So we have a domain set up for .ca and another .com

Example: mycompany.community.ca mycompany.community.com

We have learned that this wasn't necessary and now we are trying to consolidate our community sites to just one: mycompany.community.com

I want to figure out how to redirect all current users who may have bookmarked the .ca site to the .com site when they go to that page. (making this seamless for clients)

Simple URL redirect does not work because of the domains being different.

Any suggestions?

1 Answer 1


A good solution here would be to use the Apex class UrlRewriter to redirect users based on the URL. You can associate this logic with a Visualforce page or a Lightning Component that runs the code upon initialization.

The UrlRewriter class can be used to preserve query string parameters if necessary, so this makes it a good solution to handle all possible bookmarked links your users may have.

  • Thank you EvanSteeleSFDC. I didn't realize a response was received here, but certainly appreciate your time. I am looking forward to testing this!
    – B Dudley
    Feb 26, 2021 at 21:38

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.