|Available in: Salesforce Classic|
|Available in: Developer, Enterprise, Performance, and Unlimited Editions|
|To create and edit site URL redirects:||“Customize Application”|
|To view site URL redirects:||“View Setup and Configuration”|
If you move or reorganize pages on your Force.com site, search engines may have trouble finding the new page locations. To avoid this, set up site URL redirects to inform users and search engines that site content has moved.
Consider the following while implementing site URL redirects:
- You can't redirect error pages or CSS files (files with a .css extension).
- Each site can have a maximum of 1,000 redirect rules.
- Query parameters in site URL redirects are matched exactly. However, you can't redirect any URLs that include the lastMod parameter.
- If you have URL rewriting enabled on your site, it runs after any site page redirects.
- You can redirect a community home page to its companion Site.com home page. To do this, set the Source URL to /, which represents the home page for the community, and set the Target URL to s, which represents the home page for the Site.com site.
To assign a redirect to a site page:
- From Setup, enter Sites in the Quick Find box, then select Sites.
- Click a site label.
- Click URL Redirects on the site detail page.
- Specify the former page location in the Source URL field. The page location must:
- Be a relative URL. It can have any valid extension type, such as .html or .php.
- Not contain anchors, such as /siteprefix/page.html#target.
Organizations that use sites with prefixes must manually add the prefix to the Source URL and Target URL fields. Also, if your organization has a root level site and one with a prefix, and you want to redirect a page in your prefixed site but don't include the prefix in the redirect rule, Salesforce will default to looking for the rule in your root site instead, resulting in a 404 error.
- Specify the Redirect Type:
- Permanent (301)—Select this option if you want users and search engines to update the URL in their systems when visiting the page. Users visiting a page redirected with this type are sent seamlessly to the new page. Using a permanent redirect ensures that your URLs retain their search engine popularity ratings, and that search engines index the new page and remove the obsolete source URL from their indexes.
- Temporary (302)—Select this option if you want users and search engines to keep using the original URL for the page. Search engines interpret a 302 redirect as one that could change again at any time, and though they index and serve up the content on the new target page, they also keep the source URL in their indexes.
- Specify the new page location in the Target URL field. This can be a relative URL or a fully-qualified URL with an http:// or https:// prefix. Unlike source URLs, target URLs can contain anchors.
- Click Save.
The Redirect Rules section displays all URL redirect rules you've created for your site. In this section you can:
- Edit an assigned redirect rule.
- Activate or deactivate a redirect rule.
- Delete a redirect rule.
- Click the Source URL or Target URL column heading to sort the list in ascending or descending order.