No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
UrlRewriter Interface
Namespace
Usage
Sites provides built-in logic that helps you display user-friendly URLs and links to site visitors. Create rules to rewrite URL requests typed into the address bar, launched from bookmarks, or linked from external websites. You can also create rules to rewrite the URLs for links within site pages. URL rewriting not only makes URLs more descriptive and intuitive for users, it allows search engines to better index your site pages.
For example, let's say that you have a blog site. Without URL rewriting, a blog entry's URL might look like this: http://myblog.force.com/posts?id=003D000000Q0PcN
To rewrite URLs for a site, create an Apex class that maps the original URLs to user-friendly URLs, and then add the Apex class to your site.
UrlRewriter Methods
The following are methods for UrlRewriter. All are instance methods.
generateUrlFor(System.PageReference[])
Signature
public System.PageReference[] generateUrlFor(System.PageReference[] urls)
Parameters
- urls
- Type: System.PageReference[]
Return Value
Type: System.PageReference[]
Usage
You can use List<PageReference> instead of PageReference[], if you prefer.
mapRequestUrl(System.PageReference)
Signature
public System.PageReference mapRequestUrl(System.PageReference url)
Parameters
- url
- Type: System.PageReference
Return Value
Type: System.PageReference