Creating Search Engine Friendly URLs - Part 1

dleinich
Occasional Collector
3 5 2,293

When putting a lot of effort into creating content for the visitors of your website, you definitely want them to actually find it. As potential buyers and other interested parties use search engines like Google or Bing to find what they are looking for, it is important to format and present your content in a way these search engines can read and understand easily. The goal is to have your website climb the top spot on the result page after all.

There is a multitude of measures you can take to achieve this. For example proper formatted source code conveying semantic information, good and meaningful content or density of the keywords you want to be found with. Another important factor is the URL of the pages of your website. The URL can and should be “speaking” and thus informing both search engines and the user what to expect from the page at a glance.

Just have a look at the following two good vs. bad examples for a better picture:

http://www.example.com/pressreleases/our-new-product-range/

vs.

http://www.example.com/pressrelease-123.html

http://www.example.com/products/tablets/ipad-air

vs.

http://www.example.com/products/detail.jsp?productId=1337

This article is not about how to format the URL and what needs to be in it, these are business decisions that need to be made individually, but about how to actually get to the format you decided on technically. The scope of this article is to show you what FirstSpirit offers out of the box to help you achieve your goals. It will be followed by two articles talking about how the editor can influence the URL for pages he creates and what can be done to technically influence the URL generation process to match your needs even better.

URL Generation

When generating a project, FirstSpirit stores the generated files in the filesystem according to the structure that is defined in the Site Store of the projects. Page references from the Site Store are turned into actual files (for example HTML, JSP or PDF) and folders from the Site Store are mapped to folders in the filesystem. When using media in your pages, these will also be included and stored in the filesystem during the generation process.

To generate a project as described above, a schedule entry with actions is created in the ServerManager. Several options control when to generate the project, which channels and/or languages are to be generate and more. All options are explained in detail in the Manual for Administrators.

This article takes a closer look at the option PathGeneration which specifies the way directories and filenames for the generated files are named. FirstSpirit offers the following path generation options by default, the first two will be explained below:

  • Default URLs / Default URLs (SEO)
  • Advanced URLs
  • Infix URLs / Infix URLs (SEO)
  • Multiview URLs / Multiview URLs (SEO)


It is also possible to implement customer- or project-specific path generation solutions. Doing this is not in the scope of this article, though, but going to be discussed in a future article. To get started right now, please see the Manual for Module Developers (only available in German at the time of writing) for more information on this.

Default URLs


Default URLs are the "standard" way of generating URLs already available in FirstSpirit 4.2R4 and earlier. Using this generation technique URLs are generated in a way we identified as not optimal in the introduction of this article, though.


The structure of the generated URLs starts with a directory representing the language and presentation channel, for example /de/… for the first presentation channel (e.g. HTML) in German and /en_1/… for the second presentation channel in English (e.g. PDF).


Within the language directories the objects from the Site Store are filed hierarchically. This basically means that every released folder of the Site Store becomes a directory in the file system and every released page reference becomes a file. The names of the generated files is derived from the file name assigned to it in the Site Store and the names of directories from the reference name of the folder in the Site Store. This results in URLs like these:


  • /de/startpage/homepage.html
  • /de_1/startpage/homepage.pdf
  • /en/startpage/homepage.html
  • /en_1/startpage/homepage.pdf


The generation of URLs for some special cases mentioned below are described in chapter 8.5.3 of the Releasenotes of FirstSpirit 5.0 in further detail.


  • Page references included in a page group are created as single files in a new folder.

  • Content projections create one file per data record using the unique ID of the record as a suffix to the filename resulting in filenames like the following:

    • /en/press/pressreleases/pressrelease_123.html
    • /en/press/pressreleases/pressrelease_124.html
    • /en/press/pressreleases/pressrelease_125.html

  • Media elements from the Media Store will be generated to a directory alongside the language directories on top level called /media/…, the hierarchy below this directory represents the hierarchy from the Media Store. Language dependent media is put into subdirectories like /media/de/… for example.


Starting with FirstSpirit 5.0, "Default URLs (SEO)" was introduced as an additional path generation method. Using the method suffixed with SEO it is possible to benefit from the following, extended functionality.


As stability of URLs is an important factor for ranking in search engines - you want the same content to be accessible at the same URL for the longest period of time - they should remain available even if the website structure changes or the name of the page has changed. The SEO flavoured version thus stores the URL of a page reference when it is first generated.


When generating the page reference a second time, the URL is taken from this storage and not computed again. This means that you can move a page reference within the structure of the Site Store or a media in the Media Store to a different location without getting a new URL to it upon generation.


If you want to reflect the changes made in the URL permanently you have the possibility to explicitly use the "Reset stored URLs" option as a project administrator from the context menu of media, Media Store folders, page references and menu levels. Using this option the URL storage is flushed recursively for the selected elements and a new URL is assembled during the next generation.


An additional benefit of the SEO variant is that SEO URLs and Short URLs, which will be explained in the next article of this series, are taken into account during the generation process.


Advanced URLs


FirstSpirit 5.0 comes with a new API allowing the implementation of custom URL creation strategies to tailor the URLs to your needs. The API itself will be discussed in a future article, right here and now it is worth taking a look at a feature-rich example implementation using this new API which is called "Advanced URLs" and is also shipped with FirstSpirit.


When selecting "Advanced URLs" in the PathGeneration drop down of the generation settings, you instantly make use of the extended functionality described above for the SEO variant of the Default URLs.


Additionally the folder and filenames created upon generation are not like described in the previous section but in a more expressive, speaking fashion. Using this technique the URLs are based on the display name of the FirstSpirit objects meaning they are created in UTF-8 and can be rendered completely multilingual, without the segregation into language and/or presentation channel folders.


Coming back to our previous example showing URLs for the defined languages and presentation channels, we get the following result using Advanced URLs:


  • /Startseite/index.html
  • /Startseite/index.pdf
  • /Homepage/index.html
  • /Homepage/index.pdf


As you can see, there is the possibility to always use index.html for the start page of a menu level. This means it is also possible to omit it and access the pages using only /Homepage in the browser and in on-page links. This is how search engines like it best.


The special cases mentioned in the previous section are also considered and have more expressive URLs:


  • Page references included in a page group are still created in a new folder but now using the display name of the respective page reference as a filename instead of the reference name, for example /pagegroup/Acquisitions-2013.html.

  • Content projections still create one file per data record, as that is what you want, but not using the unique ID of the record as a suffix to the filename anymore. Using Advanced URLs it is possible to define a column (e.g. the headline of a press release) of the data source the projection is based on, resulting in expressive URLs such as:

    • /Press/Pressreleases/Mithras-Energy-awarded-the-Solar-Price-of-Sustainability
    • /Press/Pressreleases/New-director-of-Mithras-Energy
    • /Press/Pressreleases/Crystalline-modules-with-improved-efficiency

To specify which column of the data source is used to determin the URL the editor can switch to the "Content" tab of a page reference and select it in the component "Variable for sitemap text" as illustrated in the screenshot below.

column.PNG



  • Media elements from the Media Store will not be generated into a separate folder structure anymore but next to the other content and also using their display names for expressive, multi-lingual filenames like the following:

    • /Products/Power-Control-Panel.jpg
    • /Products/Downloads/Product-Overview.doc

Leveraging Advanced URLs is a big step in the right SEO direction and only the tip of the iceberg considering the fact that you can now implement your own requirements easily. Again, look out for a future article describing this in more detail. In the meantime you can have a look at the Releasenotes of FirstSpirit 5.0 containing more information about how to influence and configure the URL generation.


If you interested in getting more out of your URLs without implementing your own strategy, you might also want to check out the SEO-URL-Creator by our partner TWT providing configurable URLs available from our Marketplace.

Tags (2)
5 Comments
king
I'm new here

Dear Daniel Leinich,

when switching from Default to Advanced URL creation mode starting with FS 5.x - are the initial generated paths based on display names stable towards later changes (like movements from one tree-part to another, renamings). Currently, we doubt.

We suppose this is only possible when manually specifying URL mappings as part of a SEO or Short URL in the global area of FirstSpirit SiteArchitect.

Peter_Jodeleit
Crownpeak employee
Crownpeak employee

Once the url is generated, it is stable until the url is reset manually.

STrojette
Returning Observer

I just found this page because I need to adapt the URLs of a Content Projection we are using.

And exactly the one screenshot that would show me where to do this, is no longer available. 😞

EDIT:

Ha! As always, the moment I post here, I've found the place to edit the URL.

However: Is there no way to make the URL language dependend?

It seems that I can - for example - choose the German Headline OR the English Headline, but not both depending on the language channel.

Peter_Jodeleit
Crownpeak employee
Crownpeak employee
 

Even if you choose either the german or english headline field the URL is also automatically language specific - i.e. during calculating the URL the field for the correct language is used.

Peter_Jodeleit
Crownpeak employee
Crownpeak employee
Version history
Last update:
‎05-19-2014 08:42 AM
Updated by: