URL management / readable URLs in visual force

We are considering developing a new version of our website (where our customers can purchase and manage certain types of content) on the force.com platform. We have a business/usability requirement that urls needs to be readable and user friendly.

Can this be achieved when using visual force pages ? So far I’ve not come across anything trying to research this.

We would want to avoid any URL’s like http://example.com/services/​index.jsp?category=legal&id=patents, but have them as http://example.com/services/legal/patents


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You can do URL rewrites with Apex. See https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_site_urlRewriter.htm for a good explanation of how to do this.

Method 2

Assuming you are using Force.com Site for this, you can customize the url to your hearts content as long as you register your Force.com domain for your organization. You can do so under Setup -> Develop -> Sites. Then setup a redirect from your domain name to this custom url.

Check out the Sites FAQ for more info.

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x