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

Outputlink redirects to for my customer portal users. Can I change this?

We send our customer portal users a VF email template that contains links to documents and detail pages in the Customer Portal.  If a user is not already logged into the portal (which, 95% of the time, they are not), when they click the link they will be directed to to logging.  This will confuse our they need to logging from our website.


So how can I change the default behavior of the outputlink to redirect the portal user to our homepage rather than







Always ThinkinAlways Thinkin

Hi Brian,

I've been wrestling with a good way to do this for years, the best that I've come up with is hardcoding the portal parameters and inlcuding a start URL. The downside is that if they are in the portal already, I think it will take them back to the login page.


Using a standard URL in an <a> tag or <apex:outputlink>:




or get fancy and use parameters:

<apex:outputlink value="">Output Link Test
<apex:param name="orgId" value="00D800000XhXhXhXh"/>
<apex:param name="portalId" value="06080000000UJuJUJ"/>
<apex:param name="startURL" value="/{!RelatedTo.Id}"/>


Note that using login instead of your instance number ensures redirection should your instance change. 



Hi, Luke!


I realize this post is really old, but I was wondering if you had any recent revalations on this? I'm looking for a link that can route a portal user to a record if they are logged in and to send them to the appropriate portal login page if they are not. Forcing them to always log in is a pain and giving them an "already logged in" link could cause problems if they actually are not logged in. >.<


This was the only relevant post I could find with my current Google-fu.