Explore SEO URLs

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain why SEO URLs are important.
  • List three SEO URL best practices.
  • Explain why you retain the URL text that follows the hostname.
  • List four steps in the SEO URL configuration process.

Why SEO URLs?

Brandon Wilson is a senior merchandiser at Cloud Kicks, a company that specializes in high-end custom sneakers. He’s all about driving shoppers to the Cloud Kicks storefront and is eager to learn how Salesforce B2C Commerce SEO URLs can help. Optimizing site URLs for external search engines can greatly improve the shopper experience, search rankings, linking functionality, and site traffic.

 

Brandon Wilson, Cloud Kicks Merchandiser

Brandon already learned how to get shoppers to the Cloud Kicks site via automatic redirects in the Salesforce B2C Commerce Hostname Aliases module. Now, he wants to create custom, default, and page-specific URLs. He knows that URLs that are clearly named and not too long make it easier for shoppers and search engines to find relevant web pages. He plans to remove extra spaces, characters, and words, and follow some other SEO URL best practices.

Let’s take a look at his product categories, for example, to understand why this is important.

Some of his category titles include the ampersand (&). This character results in additional characters in the URL because it’s a special character in HTML. Using B2C Commerce, he can automatically eliminate or substitute all characters (including the ampersand) that need to be encoded in his URLs. For example, the Cloud Kicks category title “On the Go & Gear” includes an ampersand.

The URLs for this has an encoded ampersand (&) and '-' as blank replacement):

http://cloudkicks.web.customer.demandware.net/s/cloudkicks/on-the-go-%26-gear/hiking/

Brandon wants the ampersand to render as a hyphen in the URL, instead of the encoded %26. Using Business Manager, he can define the characters he wants B2C Commerce to remove or replace when generating URLs. He can also control how it handles leading and trailing blanks (usually remove them) and umlauts.

He creates the following rule.

Character

Replacement

&

-

 This is the resulting URL.

http://cloudkicks.web.customer.demandware.net/s/customer/on-the-go-gear/hiking/

During URL generation, B2C Commerce replaces the character on the left side of a mapping rule with the characters on the right, making the URLs more readable to search engines.

Pattern and Structure

SEO URLs are a shortened version of the standard B2C Commerce URL. B2C Commerce automatically condenses the text that follows the host name. The maximum length of a storefront URL is 1800 characters. B2C Commerce shortens URLs that are longer than this, yet keeps them valid and unique by retaining product or content IDs for product and content-specific URLs.

The B2C Commerce URL structure looks like this.

<hostname>/<endpoint>

The URL for host names that don’t end in .demandware.net, for example, cloudkicks.com/mens

<hostname>.demandware.net/s/<site-name>/<endpoint>

The URL for host names that end in .demandware.net or localhost, for example, cloudkicks-test-ex01-dw.demandware.net

B2C Commerce URLs vary by instance. Here are some examples.

Instance(s)

Examples

Production

Category: www.cloudkicks.com/men

Product: www.cloudkicks.com/shoes/sandals/red/water-sandal/12414.html

Sandbox, Staging, and Development 

Category: *.demandware.net/s/cloudkicks/men

Product: *.demandware.net/s/cloudkicks/shoes/sandals/red/water-sandal/12714.html

Remember, sandbox, staging, and development instances provide an internal view. URLs on these instances are not intended for external search engines. If you don’t define an alias on a staging, development, or sandbox instance, URLs use *.demandware.net as the host name, followed by the prefix /s, followed by the site name. You can browse all sites without having to configure aliases. The actual endpoint is identical to the one on the production instance. This lets multi-site retailers view the configured endpoints for each of their sites.

Rule Patterns

Brandon uses Business Manager to configure and customize the URL endpoint—that’s the text after the hostname. B2C Commerce generates SEO URLs based on the pattern he supplies. If he doesn’t configure a pattern, B2C Commerce uses a default. Here’s a pattern he uses.

[ category-path, [ attribute, displayName ], - ]

The pattern is also called a rule. This rule shows the category path and display name for the category, with a hyphen for the delimiter for spaces in the category name.

For example:

/mens-clothing/ (when it's a -)

/mens/clothing/ (when it's a /)

Note

Note

Configure white space replacement on the Settings tab.

Here’s a typical B2C Commerce category URL before it’s condensed.

www.cloudkicks.com/on/demandware.store/Sites-cloudkicks-Site/default/Search-Show?cgid=mens-clothing-shorts

B2C Commerce URLs can contain a lot of information that makes no sense to an external search engine. In fact, search engines typically assign lower ranking to wordy URLs with multiple directory layers and parameters… or refuse to crawl them at all.

Here’s what the URL looks like after the SEO URL feature kicks in.

www.cloudkicks.com/mens-clothing-shorts

The shorter the better!

Don’t completely remove the URL text that follows the hostname, because then there’s no way to navigate to the page. And crawlers won’t be able to index keywords that might be meaningful to the page (because they aren't there to index).

The pageURL Attribute

Brandon uses the pageURL attribute to override a pattern-based URL with an arbitrary value. Here’s an example.

pageURL attribute

/mens/clothing/1512312.hmtl, where mens/clothing is the pattern

Pattern-based URL

/men/1512312.hmtl, where men is the arbitrary attribute

Areas to Investigate

Brandon wants to investigate these additional areas.

For...

Here’s what you need to do...

Content links

If you have hard-coded links in your content assets, update them to use the content link function.

URL redirects

If your redirects are outdated or conflict with your new URLs, update them.

Static mappings and mapping rules

Make sure your redirects don’t need to be adjusted to your new URLs. If the old URLs now match the new storefront URLs, you don’t need a redirect.

Product ID search

Make sure product ID search works correctly when shoppers enter the product ID as it appears in the URL.

Sitemap

Create a sitemap that includes the SEO URLs.

Best Practices and Pitfalls

Paying attention to best practices and pitfalls helps Brandon optimize his site URLs.

Here are some best practices.

  • Make sure URLs are readable.
  • Keep URLs short.
  • Use as few folders as possible.
  • Avoid parameters.
  • Integrate specific keywords into URLs.
  • Mirror titles when possible.
  • Add keywords to URLs that improve rankings.

Consider how search engines view separators, such as:

  • They view hyphens as separators; this is common practice.
  • They can detect separate words, even if separators are not used.
  • They consider underscores as joiners and view separate words connected by underscores as a single word.
  • Case-sensitivity matters.
  • They only look at individual components of a phrase, not a phrase as a whole.

Here are some don’ts.

  • Don’t use a page type indicator or a proprietary extension sc.html in a URL.
  • Don’t use the term demandware in a URL.

What’s the Process?

Brandon is ready to configure SEO URLs. Here’s an overview of the process.

  1. SEO URLs are enabled by default. If you use SEO-friendly URLs, enable SEO URLs via storefront URL preferences.
  2. Configure hostname aliases for your site. They are required for modified URLs to appear correctly in the storefront.
  3. When the page uses multiple locales, configure locale-mapping settings. When the page has one locale, you don’t need to map anything.
    • Configure that your locale is determined from your hostname alias, URL path, or URL parameter.
    • Configure your locale within your hostname aliases configuration by using the locale and if-site-path syntax.
  4. Configure how B2C Commerce creates SEO URLs using your catalog or library. Define the rules on how the URL is created and how enabled search refinements are mapped into your URL path instead of to parameters.
  5. Configure URL character replacement settings for case (lower case), white space, and and how custom replacements are applied to your category, folder, and enabled search refinement URL mappings.
  6. Configure how you want search refinements to appear in the URL.
  7. View status and get information that helps you handle conflicts.

Brandon has a lot of tools he can use.

To...

Use...

Redirect old mappings to new mappings from older sites (for example, when migrating from other systems to B2C Commerce) B2C Commerce

Static and dynamic mapping

Automatically redirect the old mapping to the new mappings when mappings change in an existing live site (on production) from what they were in staging and development—for example, configure character replacement, so that /on-the-go-%26-gear/hiking/ automatically maps to /on-the-go-gear/hiking/

 URL archive functionality

He uses the URL search refinement redirects functionality to redirect outdated search refinement URL mappings.

Next Steps

In this unit, you learned why SEO URLs are important and how you can configure SEO URLs based on a configured pattern. You also explored best practices and pitfalls, and the overall SEO URL config process. Next, you learn how to configure SEO URLs in Business Manager.

Resources