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

  • Are you building your website using Force.com sites?
    – Anup
    Aug 2, 2012 at 12:20
  • To be honest, i'm not entirely sure of the difference (if any) between Force.com sits, and the sites you create out of your organisation. We have unlimited edition, and were planning to use the sites feature using custom portal authentication. Aug 2, 2012 at 12:22
  • 1
    If you are building customer facing website, then you are probably using the Force.com sites feature.
    – Anup
    Aug 2, 2012 at 12:26

2 Answers 2


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.


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.

  • I always get confused on most of the Salesforce lingo, but does the same go for sites developed using Site.com development tools? My org would like to have friendly URLs instead of www.company.com/ProductID=32408402482304 or whatever. Aug 2, 2012 at 14:55
  • 3
    I understand your confusion. Site.com refers to a CMS system that you can build using (mostly) point and click. The pages you build can be for both internal users as well as external customers. I was referring to Force.com site pages which are basically bunch of visualforce pages built for external users. This article will help clarify your questions. wiki.developerforce.com/page/Websites
    – Anup
    Aug 2, 2012 at 15:01
  • This answer suggests using a HTTP redirect (301/302), but from the question I believe that this refers to rendering the page using a given URL (url rewriting) and not redirecting.
    – Ryan Guest
    Jan 2, 2013 at 6:41
  • @EmmanuelF. - Site.com does support alias URL redirects so you could redirect from www.company.com/product1 to www.company.com/genericProductPage?productId=32408402482304 and the user would only ever see www.comapny.com/product1. Jan 31, 2013 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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