+ Start a Discussion
krishna p 28krishna p 28 

Page not redirecting in communities

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? 

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.