SEO optimized URL creation

FirstSpirit creates SEO-friendly URL in most cases:

http://mycompany/de/company/members/index.html

There are three major aspects where FirstSpirit’s URL creation could be improved:

  1. Support of language-specific URLs:
    Example:
    "/en/company/members/index.html"
    "/de/unternehmen/mitarbeiter/index.html"

  2. Support of special ContentStore URLs:
    Currently ContentStore URLs look like this:
    "/en/products/productdetail_12345.html"

    Improvement: Use a part of the content (e.g. title column) for the URL-creation:
    "/en/products/solar-connector-module-0815.html"

  3. Remove language prefix (for projects with only one language):
    Currently URLs look like this:
    "/<language>/products/index.html", e.g. "/en/products/index.html"

    If only one language is available in the project, the language prefix should be removed from all URLs:
    "/products/index.html"
1 Comment
Peter_Jodeleit
Crownpeak employee
Crownpeak employee

The url creation process in FirstSpirit is an open extension point, so you can create your own implementation of "de.espirit.firstspirit.access.UrlCreator", pack it into a module and deploy it on your server. It will then appear as a new choice in the configuration dialog.

But even if the implementation is no rocket science, it's also not a piece of cake Smiley Wink.

But happily you could make your life easier if you use the delegation pattern. Then the problem gets much simpler:

  1. In your implementation create an instance of one of FirstSpirit's core url creators. (Since FirstSpirit uses it's own extension mechanism for this they all have a public no-arg constructor. But be aware - the internal implementations are not part of the public nor the dev api, so the class or package name could change in future versions.)
  2. Delegate all interface calls to this instance and transform the return value where needed.

To create the above mentioned feature #3 ("remove language prefix") just strip the "/en/" from every return value. Or more simpler: Delegate to an instance of "Multiview URLs" then you must only strip the trailing ".en" in the methods concerning file names.

And how do you get those hidden class names of FirstSpirit's core url creators? I leave this as an exercise to the (experienced) reader - just one hint: Scan the api doc of "de.espirit.firstspirit.access.schedule.GenerateTask".

--Peter