Create Home Page Links

If your host is listed in site > SEO > Aliases, and only one locale is used for the site, you can create links to the home page that are search-friendly because they don't require additional information to determine the locale. In this case, you can use a hostname-only URL instead of generating links to the homepage via a Salesforce B2C Commerce pipeline. If you have a multi-locale site, ignore the rest of this topic.

For example, for a home page link in the top navigation bar, instead of generating the link via pipeline:

<a href="${URLUtils.http('Home-Show')}">home</a>

Which results in the full B2C Commerce URL being shown:

http://www.sitegenesis.com/on/demandware.store/​Sites-SiteGenesis-Site/​default/Home-Show.

Instead, directly reference the host name in a link such as the following:

<a href="http://${request.httpHost}/">home</a>

Review code that is taken from the SiteGenesis application and new custom code. This is because SiteGenesis is based on a multi-locale site and uses pipeline to generate home page links.

Check that the home page link is generated via the pipeline Home-Show in the following SiteGenesis templates:

When these templates are used in a custom application, the code must be modified to deliver the hostname-only URL.

Issuing Hostname-Only Requests

Hostname-only requests can be issued with or without one or more parameters, with the following default destinations:

Hostname only Default destination Example
Without parameters Default-Start www.my-host.com/
With one or more parameters RedirectURL-Start www.my-host.com/?param=aValue, enabling you to use the mapping rules functionality.

The configuration value apply-to-host-only-request-with-params enables you to forward hostname requests with parameters to the configured pipeline, for example:

"www.my-host.com":[{"pipeline":"Home-Show", "apply-to-host-only-request-with-params":"true"}] 

This example forwards the requests www.my-host.com/ and www.my-host.com/?param=aValue to the Home-Show pipeline and preserves the original URL parameters.

Related Links

Configuring SEO URLs

Dynamic Mappings

Hostname Aliases

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.