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
krishna p 28krishna p 28 

Page not redirecting in communities

HI,
For a guest user, in community portal, page is not redirecting to next page. These are custom pages for which I have custom controllers. In salesforce pages are redirecting well and functionality is working fine. But in portal, on button click the same page is reloaded without any action.
below is th ecode I am using ot redirect to next page,
pageReference pageref = new pageReference(siteUrl+sitePrefix+'/Custom_Page'+'?param='+id);

what might be the reason? 

Regards,
Krishna
Amit Chaudhary 8Amit Chaudhary 8
Please try to add your community Name in url like below

pageReference pageref = new pageReference('CommunityName/apex/Custom_Page'+'?param='+id);

Please let us know if this will help you
krishna p 28krishna p 28
HI Amit,
Thanks for the reply. 
siteurl = Site.getBaseSecureUrl();
sitePrefix = Site.getPathPrefix();
I have implemented in controller.
Radha GmailRadha Gmail
This solution of passing full url with community name worked for me.