Upgrade URL Rewriter

Enterprise Add-on

As of CMS 12, the former forge-based URL Rewriter plugin is an Enterprise Add-on. The documentation of the old version(s) can now be found at a new location.

Upgrade Steps

Since the plugin is now an Enterprise Add-on, it uses different Maven coordinates. To upgrade to using the Enterprise Add-on, perform the following steps:

  1. In your cms module, replace the following dependencies:

    <dependency>
      <groupId>org.onehippo.forge.urlrewriter</groupId>
      <artifactId>urlrewriter-module-repository</artifactId>
      <version>X.Y.Z</version>
    </dependency>
    <dependency>
      <groupId>org.onehippo.forge.urlrewriter</groupId>
      <artifactId>urlrewriter-module-cms</artifactId>
      <version>X.Y.Z</version>
    </dependency>
    

    with:

    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-urlrewriter-module-repository</artifactId>
    </dependency>
    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-urlrewriter-module-cms</artifactId>
    </dependency>
    
    The version of the Enterprise Add-on artifacts is controlled by the Enterprise Release project, and does not need to be specified anymore.
  2. In your site module(s), replace the following dependency:

    <dependency>
      <groupId>org.onehippo.forge.urlrewriter</groupId>
      <artifactId>urlrewriter-module-hst</artifactId>
      <version>X.Y.Z</version>
    </dependency>
    

    with:

    <dependency>
      <groupId>com.onehippo.cms7</groupId>
      <artifactId>hippo-addon-urlrewriter-module-hst</artifactId>
    </dependency>
    
  3. If your project used Maven dependency management for these 3 artifacts, these dependencies can be removed (from the project's root POM, most likely). Also, if your project specified a version property for these three artifacts, that property should no longer be needed and can be removed.

Configuration Relocation

URL Rewriter has a few global configuration properties. Before CMS 12, they were stored on the /content/urlrewriter node. As of CMS 12, they are stored in the module configuration, on the /hippo:configuration/hippo:modules/urlrewriter/hippo:moduleconfig node. During the migration of the project's bootstrap resources, these global configuration properties have been moved automatically. This relocation also triggers a change to URL Rewriter's site Spring configuration, in order to make sure that configuration changes take effect immediately.

Upgrade Steps

  1. Update URL Rewriter's site Spring configuration file (typically found at site/src/main/resources/META-INF/hst-assembly/overrides/urlrewriting-context.xml) to add a second event listener on the new configuration path, and to set the new property 'configurationLocation' on the RewritingManager. The default content of this file is provided in our open source repository.
  2. Your CMS 11 project most likely bootstrapped the /content/urlrewriter node itself. Using the CMS 12 URL Rewriter Enterprise Add-on, this node is provided by the add-on, and you should remove it from your project's YAML sources, typically found under /repository-data/application/src/main/resources/hcm-config. Make sure not to remove any to-be-bootstrapped URL rewriter rules though. Typically, these should live in /repository-data/development/src/main/resources/hcm-content.
  3. When the Configuration Model is merged during the start-up of your project, you will see a WARN-level log message for any URL Rewriter global configuration property defined in your project, which has a value equivalent to the default value provided by the add-on. Removing these definitions from your project makes your project leaner and silences these warnings.

 

Hide URL Rewriting Rule for Non-Admin Users

As of CMS 12, URL Rewriter by default hides the section for managing URL rewriting rules in the CMS for non-admin users. This is changed behaviour compared to the old forge plugin. If your project intends to provide access to all users rather than admin users only, you should revert this hiding in the configuration definitions of your project.

Upgrade Steps

(Only relevant if your project intends to deviate from the recommendation to hide the URL rewriting rules from non-admin users)

  1. To make the URL rewriting rule management section of the CMS' Content perspective visible and accessible to all users, add the following configuration definition to your project:

    definitions:
      config:
        /hippo:configuration/hippo:domains/frontendconfig/frontend-plugins/hide-urlrewriter-section:
          .meta:delete: true

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?

    We rely on cookies

    to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

    Manage cookies
    Accept & close

    Cookies preferences

    Accept & close
    Back