Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sites provides built-in logic that helps you display user-friendly URLs and links to site visitors. For that we need to implement Site.UrlRewriter interface and create our own class to map user-friendly URLs.

When I convert the URL with less than 2 parameters, and when I use test link it correctly converts the VF page link with query params to an User-Friendly URL.

But when I have more than 2 parameters (3 and above), it does not correctly map and renders the link properly. Meaning it will show the VF page link with query params instead of user-friendly URL.

I checked by putting debug logs on my Site.UrlRewriter implementation class, and it gives me the correct user-frienly url. I also checked for any limitation on URLFOR tag on VF page. I also checked for character length limitation on the URL, but I don't find any viable solution for this.

Please advice me, if anybody has experience with this Site.UrlRewriter

share|improve this question
Can you add some examples as it may help diagnose your problem? – Jon Hazan Nov 23 '12 at 10:19
Below is the standard VF Page query param link (relative path) /EVW_PublicationDetail?pid=123456789012345678&purOptId=123456789012345678&pkgOpt‌​Id=1 we need to convert it to a user-friendly url as below /catalog/publication/123456789012345678/purchase-option=123456789012345678/packa‌​ge-option=2131654645. For this conversion there is an interceptor interface Site.UrlRewrite where we need to implement. I implemented it. It works well when you have upto 2 parameters. when I have 3 or more parameters the conversion does not work. – TonyTuan Nov 23 '12 at 10:55
I implemented the Site.UrlRewriter on my dev org following the documentation. Same thing, the class returns the correct url, but when this is with 2+ parameters, it seems to not get applied by Visualforce. I think you may need to contact Sf support. – Samuel De Rycke Nov 27 '12 at 8:56
I see this problem and question is from 2012... Now, 2014, I have the same problem or inconvenience... I think the solution is do some tricky and ugly code and pass only one parameter like a string with all the needed parameters. This is very ugly and uncofortable. – Daniel Morales Dec 19 '14 at 13:39

You are not alone - this is a known issue with using URLFOR and the Site.UrlRewriter interface. Your best bet is to use a workaround (like hardcoding the URLs into your visualforce page).

If you need it for a case, the internal salesforce reference number is W-957534.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.