The URL optimization classes are designed to increase your search engine rankings by enabling you to create search engine-friendly URLs.
Many search engines evaluate URL strings as part of their relevancy ranking strategy. Generating URLs that include keywords can increase your natural search engine ranking as well as create visitor-friendly URLs that are easier for front-end users to understand.
Using the URL optimization classes, you can configure the following strings to appear in the URL:
For example, the base URL for a Merlot page in a wine application configured to include ancestors in the string could appear as:
http://localhost/ContentAssemblerRefApp/Content.aspx/Wine-Red-Merlot/
The optimized URL is more comprehensible to users and more search-engine friendly than the traditional URL, which contains no keywords:
http://localhost:8888/endeca_jspref/controller.jsp?sid=122C7EA4C912&Ne=6200&enePort=15000&eneHost=localhost&N=8025
Dynamic sites often produce syntactically different URLs for the same page. Multiple variant URLs result in duplicate content and lower search engine ranking.
For example, users might be able to reach a Napa white wine page by first clicking on “Napa” and then clicking on “White”, or by first clicking on “White” and then “Napa.” This creates two syntactically unique links pointing to the same Napa White page:
To ensure that only one version of the URL per page is used in links
throughout the site, the
com.endeca.soleng.urlformatter .NavStateCanonicalizer
interface provides options for creating a single "canonical" URL for a given
location.
It is possible to customize the word separator for each keyword string in the URLs. By default, the word separator is the dash character "-":
http://localhost:8888/urlformatter_jspref/controller/Wine-White/Region-Germany/_/N-1z141vcZ66t
In order to create directory-style URLs, you can limit the number of parameters in the query string by moving them from the query string and into the path-params section of the URL.
For example, the following URL has the parameters
N
,
Ntk
,
Ntt
, and
Ntx
in the query string:
http://localhost/ContentAssemblerRefApp/Content.aspx/Bordeaux?N=4294966952&fromsearch=false&Ntk=All&Ntt=red&Ntx=mode%2bmatchallpartial
To optimize the URL, you can move parameters into the path-params
section of the URL. For example, the following URL includes the
N
and
Ntt
parameters in the base URL:
http://localhost/ContentAssemblerRefApp/Content.aspx/Bordeaux/_/N-4294966952/Ntt-red?fromsearch=false&Ntk=All&Ntx=mode%2bmatchallpartial
In order to shorten URLs, the URL optimization classes allow base-36 encoding of parameters.
For example, the following URL for Vintage > 1996 contains the dimension value ID for 1996 (4294962059):
http://localhost/ContentAssemblerRefApp/Content.aspx/_/N-4294962059
By base-36 encoding the N parameter, you can shorten the URL:
http://localhost/ContentAssemblerRefApp/Content.aspx/_/N-1z13xxn