Newer Version Available

This content describes an older version of this product. View Latest

Creating and Editing Force.com Sites

Available in: Developer, Enterprise, Performance, and Unlimited Editions

User Permissions Needed
To create and edit Force.com sites: “Customize Application”
After registering your Force.com domain, create a Force.com site using the following steps:
  1. From Setup, click Develop | Sites.
  2. Click New or click Edit for an existing site.
  3. On the Site Edit page, define the following:
    Field Description
    Site Label The name of the site as it appears in the user interface.
    Site Name The name used when referencing the site in the SOAP API. This name can contain only underscores and alphanumeric characters, and must be unique in your organization. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
    Site Description An optional description of the site.
    Site Contact The user who will receive site-related communications from the site’s visitors and salesforce.com.
    Default Web Address The unique Force.com URL for this site. Force.com provides the first part of the URL based on the domain name that you registered; you must add a unique site name to the end. Unless you configure a custom Web address through a domain name registrar, this is the URL that the public will use to access your site.
    Active The option that activates your site when you are ready to make it available to the public. You can also activate your site from the Sites and Site Details pages. When the site is inactive, users will see the page specified in the Inactive Site Home Page field.
    Active Site Home Page The landing page that users are directed to when this site is active. Use the lookup field to find and select the Visualforce page that you developed for your site’s home page. Choose the UnderConstruction page if you just want to test your site.

    For ideas sites, you must use the IdeasHome page and for answers sites you must use the AnswersHome page. The “look and feel” for your Ideas site or Answers site will be inherited from its associated portal unless you select a site template.

    If you deployed a site before the Summer ’10 release, you can set AnswersHome as your default landing page if you create a Visualforce page using <apex:page action="{!URLFOR('/answers/answersHome.apexp')}"/>

    Inactive Site Home Page The landing page that users are directed to when this site is inactive. Use the lookup field to find and select the page that you want to use. You can, for example, select a page to indicate that the site is under construction or down for maintenance.
    Site Template The template that provides the page layout and stylesheet for your site. The site template overrides any formatting inherited from the associated portal. Use the lookup field to find and select a template that you’ve developed, or use the out-of-box template provided.

    The site template specified here is used only for Visualforce pages using the $Site.Template expression.

    Note

    Site Robots.txt A file that determines which parts of your public site Web spiders and other Web robots can access. Web robots are often used by search engines to categorize and archive websites. HTML tags are not allowed, as they are not compatible with robots.txt spiders. For Visualforce pages, add contentType="text/plain" to the <apex:page> tag.
    Example disallowing all robots from indexing all pages:
    1<apex:page contentType="text/plain">
    2    User-agent: *  # Applies to all robots
    3    Disallow: /    # Disallow indexing of all pages
    4    </apex:page>
    Example allowing all robots to index all pages:
    1<apex:page contentType="text/plain">
    2            User-agent: *  # Applies to all robots
    3            Disallow:      # Allow indexing of all pages
    4            </apex:page>
    Site Favorite Icon The icon that appears in the browser’s address field when visiting the site. Use this field to set the favorite icon for your entire site instead of for each page. Changes will be reflected on your site one day after you make them, due to caching.
    Analytics Tracking Code The tracking code associated with your site. This code can be used by services like Google Analytics to track page request data for your site.
    URL Rewriter Class An Apex class to use for rewriting URLs for your site, from Salesforce URLs to user-friendly URLs. With this class, you can make rules to rewrite site 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.
    Enable Feeds The option that displays the Syndication Feeds related list, where you can create and manage syndication feeds for users on your public sites. This field is visible only if you have the feature enabled for your organization.
    Clickjack Protection Level
    You can set the clickjack protection for a site to one of these levels:
    • Allow framing by any page (no protection)
    • Allow framing by the same origin only (recommended)
    • Don’t allow framing by any page (most protection)

    Same-origin framing allows the site’s page to be framed only by pages on the same domain name and protocol security.

    Note

    Salesforce Communities have two clickjack protection parts—one for the Force.com Communities site which is set from the Force.com site detail page and another for the Site.com Communities site which is set from the Site.com configuration page. It's recommended that both are set to the same value.

    Note

  4. Click Save.

You define Custom URLs from Domain Management in Setup.

Note