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
SScholtzSScholtz 

Winter '14: outputLink automatically adding site prefix?

We just noticed an issue today with some links we had on our Force.com site where some links to download some PDFs (stored as Documents in SF) were broken in our test environment (Winter '14) but not on production (still Summer '13)

The code looks something like this:

 

<apex:outputLink value="/mySite/servlet/servlet.FileDownload?file={!formPDFId}&oid={!$Organization.Id}"
styleClass="standard-blue-button" target="_blank">
{!$Label.lnk_PrintConsentForm}
</apex:outputLink>

 

 

In production, the link is fine, but in our staging environments, it seems like Winter '14 is automatically adding in the site prefix, even though I didn't ask it to, so I end up with /mySite/mySite/servlet/....

 

Anybody else experiencing this? Didn't find anything in the release notes related to outputLink or site prefix.

SScholtzSScholtz

A quick update:

If I change the url to something like this:

{!$Site.prefix}/servlet/....

Winter '14 doesn't double up the url, but if it's hardcoded...

/mySite/servlet...

Then it does, ending up with /mySite/mySite/servlet..... Summer '13 doesn't seem to be doing this 'helping'.

 

EDIT: ooops, actually the "helper" doesn't spit out /mySite/mySite/, the issue is that we have another site using the same page, so the url ends up "/myOtherSite/mySite/....".  On the original site it seems to be ok (ther helper is parsing the hard coded mySite or Site.prefix fine) but on the other site, it tries to help by putting the site prefix in there for you...

jaw999jaw999
For me to get it to work in my sandbox I had to do:
<apex:outputLink value="{!$Site.prefix}/{!c.id}" target="blank">
Harshal KolheHarshal Kolhe
IF you want to redirect the page to another vf page.
<apex:outputLink value="{!$Site.Prefix}/apex/yourPageName"  >Redirect</apex:outputLink>