Find your content:

Search form

You are here

Site.UrlRewriter Interface implementation problem with more than 2 parameters


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

Attribution to: TonyTuan

Possible Suggestion/Solution #1

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.

Attribution to: Ryan Guest
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content