rewrite seo url Developer Legacy

How to call the view of a node from the URL when SEO rules are applied on that node?


The customer would like to call the view (default or non-default) of a node and SEO rule is applied to this node.


The first constraint is that a content template for each view has to be created.

The second constraint is that only one content template could be the default one.
This means that calling a node with the default view return the view of the default content template.

To bypass these constraints, a solution is to use your own SEO URL rewriting.

As mentioned in the documentation link,

you can define it as below:

- modules/**/META-INF/seo-urlrewrite*.xml

Here is a module to illustrate this SEO URL rewriting:
The rule is the following one seo-urlrewrite-test7121.xml:

        <name>Append servername</name>
        <note>Check if we need to add server name</note>

This rule means that every URL containing /titi/[content template name].html is converted to /cms/render/live/en/sites/mySite/home/pagecontent/[content template name].html

In this module, a default content template "vuesimple" and a content template "details" are defined

So, when entering in Live mode: http://desktop-o9jivla:8080/titi/test.vuesimple.html or http://desktop-o9jivla:8080/titi/test.html, the SEO URL rewriting is applied and convert the URL to: /cms/render/live/en/sites/mySite/home/pagecontent/test.vuesimple.htm

And when entering in Live mode: http://desktop-o9jivla:8080/titi/test.details.html, the SEO URL rewriting is applied and convert the URL to: /cms/render/live/en/sites/mySite/home/pagecontent/test.details.html