Jahia DX > URL rewriting

0 (0 Good)
0 (0 Bad)

URL rewriting

by  adeforsan »  2011/06/07 17:57

Is there a way to choose URL like REST ? ex: for a news not "/news/maincontent/news_36.html" but "/newslist/news/36" ?

Anne de Forsan (adeforsan)

Number of messages  57
Registration date
0 (0 Good)
0 (0 Bad)

Re: URL rewriting

by  adeforsan »  2011/06/07 17:57

URL rewriting is fully supported, either at the application level (to allow for regular expression rewriting), or at the page level with the support of vanity URLs (the ability to associate a list of fully customized URLs to each page).

Anne de Forsan (adeforsan)

Number of messages  57
Registration date
0 (0 Good)
0 (0 Bad)

Re: URL rewriting

by  wik »  2011/06/07 17:57

 

URL rewriting is fully supported, either at the application level (to allow for regular expression rewriting), or at the page level with the support of vanity URLs (the ability to associate a list of fully customized URLs to each page).

I can't get it working in Jahia v6.5 demo...

For example, I have following record in the Display Vanishing URL section of ACME site settings:

http://localhost:8080/news/acme-signs-a ... hnice.html (Mapping)

http://localhost:8080/cms/edit/default/ ... ws_34.html (Page)

If I click on the page, it's opening just fine, but any URL from the Mapping tab refering to 404 page.

Should I do anything extra in order to get it working?

 

Thanks.

  • Re: URL rewriting
    2011/06/30 16:06

    wik <p> &nbsp;</p> <p> <title></title> </p> <blockquote> <p> URL rewriting is fully supported, either at the application level (to allow for regular expression rewriting), or at the page level with the support of vanity URLs (the ability to associate a list of fully customized URLs to each page).</p> </blockquote> <p> I can&#39;t get it working in Jahia v6.5 demo...</p> <p> For example, I have following record in the <strong>Display Vanishing URL</strong> section of <strong>ACME site settings</strong>:</p> <p> <a href="http://localhost:8080/news/acme-signs-a-partnership-with-polytechnice.html">http://localhost:8080/news/acme-signs-a ... hnice.html</a> (Mapping)</p> <p> <a href="http://localhost:8080/cms/edit/default/en/sites/ACME/home/news/maincontent/news_34.html">http://localhost:8080/cms/edit/default/ ... ws_34.html</a> (Page)</p> <p> If I click on the page, it&#39;s opening just fine, but any URL from the <strong>Mapping</strong> tab refering to 404 page.</p> <p> Should I do anything extra in order to get it working?</p> <p> &nbsp;</p> <p> Thanks.</p>

  • Number of messages  4
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  pap@commaro.com »  2011/06/07 17:57

    Hello,

    the vanity urls do not work as long as you use "localhost" as the server-name. For now you can still use for instance 127.0.0.1 , but it would be better if you use your IP or a name (e.g. your workstation name or you can map a name to 127.0.0.1 in your \Windows\System32\drivers\etc\hosts file).

    Regards,
    Benjamin

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  wik »  2011/06/07 17:57

     

    pap@commaro.com wrote:

    Hello,

    the vanity urls do not work as long as you use "localhost" as the server-name. For now you can still use for instance 127.0.0.1 , but it would be better if you use your IP or a name (e.g. your workstation name or you can map a name to 127.0.0.1 in your \Windows\System32\drivers\etc\hosts file).

    Regards,

    Benjamin

    I've mapped http://www.example.com to 127.0.0.1 and updated "Site server name" property, but any vanity URL still referring to "404 - not found" page...

     

    Thanks.

  • Re: URL rewriting
    2011/06/30 16:08

    wik <p> &nbsp;</p> <p> <title></title> </p> <blockquote> <p> <strong>pap@commaro.com wrote:</strong></p> <p> Hello,</p> <p> the vanity urls do not work as long as you use &quot;localhost&quot; as the server-name. For now you can still use for instance 127.0.0.1 , but it would be better if you use your IP or a name (e.g. your workstation name or you can map a name to 127.0.0.1 in your \Windows\System32\drivers\etc\hosts file).</p> <p> Regards,</p> <p> Benjamin</p> </blockquote> <p> I&#39;ve mapped <a href="http://www.example.com/">http://www.example.com</a> to 127.0.0.1 and updated &quot;Site server name&quot; property, but any vanity URL still referring to &quot;404 - not found&quot; page...</p> <p> &nbsp;</p> <p> Thanks.</p>

  • Number of messages  4
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  pap@commaro.com »  2011/06/07 17:57

    Benjamin Papez (pap@commaro.com)

    Number of messages  220
    Registration date
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  wik »  2011/06/07 17:57

     



    No, it doesn't, 404 error.

    On live site it's displayed like this:
    http://www.example.com:8080/cms/render/ ... lytechnice

    i.e. with render/live and without .html

    Quite different than listed in Vanity URLs panel...

  • Re: URL rewriting
    2011/06/30 16:10

    wik <p> &nbsp;</p> <blockquote> <div> <cite>pap@commaro.com wrote:</cite>Hello,<br /> <br /> can you try if one of this links work:<br /> <br /> <a href="http://www.example.com:8080/cms/news/acme-signs-a-partnership-with-polytechnice.html">http://www.example.com:8080/cms/news/acme-signs-a-partnership-with-polytechnice.html</a><br /> <a href="http://www.example.com:8080/cms/acme-signs-a-partnership-with-polytechnice.html">http://www.example.com:8080/cms/acme-signs-a-partnership-with-polytechnice.html</a><br /> <br /> Regards,<br /> Benjamin</div> </blockquote> <br /> <br /> <p> No, it doesn&#39;t, 404 error.<br /> <br /> On live site it&#39;s displayed like this:<br /> <a href="http://www.example.com:8080/cms/render/live/news/acme-signs-a-partnership-with-polytechnice">http://www.example.com:8080/cms/render/ ... lytechnice</a><br /> <br /> i.e. with&nbsp;render/live&nbsp;and without&nbsp;.html<br /> <br /> Quite different than listed in Vanity URLs panel...</p>

  • Number of messages  4
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  madsbuus »  2011/06/07 17:58

    Just tried latest nightly.

    This is still not working at all. Using the shortest possible vanity url such as 'test' still renders as

    /cms/render/live/test

    which is really annoying. It should be default be /test, since jahia is hosted as 'ROOT' in tomcat.
    I've studied the urlrewrite.xml and seo-urlrewrite.xml and it seems to do a lot of juggling, but it doesn't work. The configuration (as far as I understand it), still keeps /cms/ 

    Here's my view on all the different parts of the urls:

    * /cms/: This is crazy: An end user has not visited a 'cms' but a site. most users have no idea what a cms is). Just drop this and more other resources/edit mode etc. into a technical prefix'

    * /render/live : The 'render/live' is also completely redundant as from an end user perspective absurd to keep in any url.

    * .html suffix: The .html is too oldschool for me and just adds 'technical noise' to urls. End users should not know about html, and boosting the term 'html' for SEO purposes in not interesting. I understand (also for REST stuff) that other formats (such as xml, json etc.) makes sense, but .html urls are different: They are visible in a browser
    .
    * Vanity URLs. What a bad name for this. This has nothing to do with the site owners vanity, but the end user experience :-). But IMO you could skip vanitys urls altogether, if every page was just mapped into the url as most would expect: /page/subpage/subsubpage etc.
    That would solve 90% of peoples needs. 
    The use case for overwriting a single page URL with another is still there, but it is marginal compared to nice urls on general pages.

    Any comments?

  • Re: URL rewriting
    2011/06/30 16:11

    madsbuus <p> Just tried latest nightly.<br /> <br /> This is still not working at all. Using the shortest possible vanity url such as &#39;test&#39; still renders as<br /> <br /> /cms/render/live/test<br /> <br /> which is really annoying. It should be default be /test, since jahia is hosted as &#39;ROOT&#39; in tomcat.<br /> I&#39;ve studied the urlrewrite.xml and seo-urlrewrite.xml and it seems to do a lot of juggling, but it doesn&#39;t work. The configuration (as far as I understand it), still keeps /cms/&nbsp;<br /> <br /> Here&#39;s my view on all the different parts of the urls:<br /> <br /> * /cms/: This is crazy: An end user has not visited a &#39;cms&#39; but a site. most users have no idea what a cms is). Just drop this and more other resources/edit mode etc. into a technical prefix&#39;<br /> <br /> * /render/live : The &#39;render/live&#39; is also completely redundant as from an end user perspective absurd to keep in any url.<br /> <br /> * .html suffix: The .html is too oldschool for me and just adds &#39;technical noise&#39; to urls. End users should not know about html, and boosting the term &#39;html&#39; for SEO purposes in not interesting. I understand (also for REST stuff) that other formats (such as xml, json etc.) makes sense, but .html urls are different: They are visible in a browser<br /> .<br /> * Vanity URLs. What a bad name for this. This has nothing to do with the site owners vanity, but the end user experience&nbsp;<img alt=":-)" src="http://10.8.37.193/forum/images/smilies/icon_e_smile.gif" style="margin-top:0px;margin-bottom:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;" title="Smile" />. But IMO you could skip vanitys urls altogether, if every page was just mapped into the url as most would expect: /page/subpage/subsubpage etc.<br /> That would solve 90% of peoples needs.&nbsp;<br /> The use case for overwriting a single page URL with another is still there, but it is marginal compared to nice urls on general pages.<br /> <br /> Any comments?</p>

  • Number of messages  8
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  rvt »  2011/06/07 17:58

     

    Mad,

     

    did you set

    urlRewriteSeoRulesEnabled = true

    in jahia.properties?

    When I did set it to true I was beable to change the URL rewriting.

    I couldn't yet remove the /cms/ and /sites/ path, but the render/live portion was gone.

    Ries

  • Re: URL rewriting
    2011/06/30 16:13

    rvt <p> &nbsp;</p> <p> <title></title> </p> <p> Mad,</p> <p> &nbsp;</p> <p> did you set</p> <pre> urlRewriteSeoRulesEnabled = true</pre> <p> in jahia.properties?</p> <p> When I did set it to true I was beable to change the URL rewriting.</p> <p> I couldn&#39;t yet remove the /cms/ and /sites/ path, but the render/live portion was gone.</p> <p> Ries</p>

  • Number of messages  185
    Registration date Jun 7, 2011
    0 (0 Good)
    0 (0 Bad)

    Re: URL rewriting

    by  shyrkov »  2011/06/07 17:58

    Hello Mads,

    thank you very much for the feedback and sharing your concerns! It is really valuable to us, especially before the final release as we have a chance to bring changes in more easily.

    I will provide an overview of the resource URL and SEO concepts we based on Jahia 6.5 (I will be talking now not about BETA-1, but about the recent nightly builds).

    The resource URLs in Jahia 6.5 have unified form, including mode (render, edit, contribute), workspace (default or live), language, path and template type (.html, .rss, .csv etc.). Optionally also template.
     

       /cms/<mode>/<workspace>/<language>/<path>[.<template>].<template-type>

    e.g.:

       /cms/edit/default/en/sites/ACME/home/about-us.html
       /cms/render/live/en/users/root.user-content.html ("user-content" is a template here)

    The so called "SEO-friendly URLs" (or Vanity URLs) were designed to have "alternative" URLs for the same resource, mainly for maintenance (moving pages to new locations), migration (migrating e.g. an old PHP or vanily HTML site to Jahia) or marketing purposes (http://www.my-company.com/special-offers ).

    They are language dependent per se, so you can have /special-offers for your English page and /sonderangebote for the same page in German, for example.

    Note please that SEO-fiendly URLs are not activated when you access you server using "localhost" and are only applied in "preview" and "live" modes (no need to mess things up in edit and contribute modes).

    Now the point about rewriting ("shortening") URLs.
    Considering multi-faceted aspects and complexity of projects, where Jahia is usually involved, we do not enable the URL rewriting by default, but we do provide an out-of-the-box SEO-friendly configuration, using built-in URLRewrite engine. Of course front-end Web server or proxy rewriting can be utilized as well, if needed.

    I will try to bring light on what can be done with the built-in rewriting.
    You need to enable it explicitly by setting the following value in WEB-INF/etc/config/jahia.properties file to true:

      # Enable this option to make URL rewrite engine "shorten" the URL to
       # content in live mode, .e.g.:
       #     http://my.acme.org/cms/render/live/en/site/myAcme/home.html
       # can become:
       #     http://my.acme.org/cms/home.html
       urlRewriteSeoRulesEnabled                              = true

    This will enable rewriting rules, defined in WEB-INF/etc/config/seo-urlrewrite.xml
    The rules will be applied in Live mode only and only when you server is accessed not with "localhost" servername.

    What will be rewritten:
    1) Use case 1: you have a virtual site with the "my.acme.org" defined as a server name and a single language (no mater which one)
    In such a case the URL:

       http://my.acme.org/cms/render/live/en/site/myAcme/home/about-us.html

    will get the form:

       http://my.acme.org/cms/home/about-us.html

    will get the form:

       http://my.acme.org/cms/home/about-us.html

    So, the "/render/live" (technical part), the language "/en" and site "/site/myAcme" parts are removed as they can be unambiguously re-constructed, based on the server name.

    2) Use case 2: same as use case 1, but you have your site in more than one language. In such a case the "short" URL will have the language in it:

    http://my.acme.org/cms/en/home/about-us.html

    3) Use case 3: same as 2 (site with multiple lanagues and proper servername) but with SEO-friendly (vanity) URLs. Let's say for /home/about-us.html page you have a /about

    You will get the following as a result: 

     http://my.acme.org/cms/about
    Note that we have a rule (can be specified in your module's rule.drl file) to automatically create SEO-friendly URL mappings, based on the content node title (language-dependent).


    Now the last, but not the least, the point about "/cms" in the URL, with is preserved right now.
    It distinguishes the rendering of content from other "controllers", like serving files (/files), WebDAV access (/repository) and others.
    We have not identified so far a 100% scenario, when we can remove also the "/cms" but still unambiguously re-recrate back the original URL. But we will review it once again, for sure.
    It really depends on a particular project, where Jahia is used.
    In simple cases, it is possible to also provide a rule to leave /cms out and even remove ".html" from URLs, but it depends on the business constraints and the implementation, selected in templates.
    You can easily modify or extend the rewriting rules in the seo-urlrewrite.xml file to meet your project needs. That is why we do not "enforce" those rules by default.

    We will keep you informed on the further evaluation of SEO concepts in Jahia 6.5 and will appreciate any feedback, comments, wishes, bug reports through our Forum (http://www.jahia.org/forum) or bug and change request tracking system (http://jira.jahia.org/).

    Thank you in advance!


    Kind regards
    Sergiy

     

  • Re: URL rewriting
    2011/06/30 16:19

    shyrkov <p> Hello Mads,<br /> <br /> thank you very much for the feedback and sharing your concerns! It is really valuable to us, especially before the final release as we have a chance to bring changes in more easily.<br /> <br /> I will provide an overview of the resource URL and SEO concepts we based on Jahia 6.5 (I will be talking now not about BETA-1, but about the recent nightly builds).<br /> <br /> The resource URLs in Jahia 6.5 have unified form, including mode (render, edit, contribute), workspace (default or live), language, path and template type (.html, .rss, .csv etc.). Optionally also template.<br /> &nbsp;</p> <pre> /cms/&lt;mode&gt;/&lt;workspace&gt;/&lt;language&gt;/&lt;path&gt;[.&lt;template&gt;].&lt;template-type&gt;</pre> <p> e.g.:</p> <pre> /cms/edit/default/en/sites/ACME/home/about-us.html /cms/render/live/en/users/root.user-content.html (&quot;user-content&quot; is a template here)</pre> <p> The so called &quot;SEO-friendly URLs&quot; (or Vanity URLs) were designed to have &quot;alternative&quot; URLs for the same resource, mainly for maintenance (moving pages to new locations), migration (migrating e.g. an old PHP or vanily HTML site to Jahia) or marketing purposes (<a href="http://www.my-company.com/special-offers">http://www.my-company.com/special-offers</a>&nbsp;).<br /> <br /> They are language dependent per se, so you can have /special-offers for your English page and /sonderangebote for the same page in German, for example.<br /> <br /> Note please that SEO-fiendly URLs are not activated when you access you server using &quot;localhost&quot; and are only applied in &quot;preview&quot; and &quot;live&quot; modes (no need to mess things up in edit and contribute modes).<br /> <br /> Now the point about rewriting (&quot;shortening&quot;) URLs.<br /> Considering multi-faceted aspects and complexity of projects, where Jahia is usually involved, we do not enable the URL rewriting by default, but we do provide an out-of-the-box SEO-friendly configuration, using built-in URLRewrite engine. Of course front-end Web server or proxy rewriting can be utilized as well, if needed.<br /> <br /> I will try to bring light on what can be done with the built-in rewriting.<br /> You need to enable it explicitly by setting the following value in WEB-INF/etc/config/jahia.properties file to true:</p> <pre> # Enable this option to make URL rewrite engine &quot;shorten&quot; the URL to # content in live mode, .e.g.: # http://my.acme.org/cms/render/live/en/site/myAcme/home.html # can become: # http://my.acme.org/cms/home.html urlRewriteSeoRulesEnabled = true</pre> <p> This will enable rewriting rules, defined in WEB-INF/etc/config/seo-urlrewrite.xml<br /> The rules will be applied in Live mode only and only when you server is accessed not with &quot;localhost&quot; servername.<br /> <br /> What will be rewritten:<br /> 1) Use case 1: you have a virtual site with the &quot;my.acme.org&quot; defined as a server name and a single language (no mater which one)<br /> In such a case the URL:</p> <pre> http://my.acme.org/cms/render/live/en/site/myAcme/home/about-us.html</pre> <p> will get the form:</p> <pre> http://my.acme.org/cms/home/about-us.html</pre> <p> will get the form:</p> <pre> http://my.acme.org/cms/home/about-us.html</pre> <p> So, the &quot;/render/live&quot; (technical part), the language &quot;/en&quot; and site &quot;/site/myAcme&quot; parts are removed as they can be unambiguously re-constructed, based on the server name.<br /> <br /> 2) Use case 2: same as use case 1, but you have your site in more than one language. In such a case the &quot;short&quot; URL will have the language in it:</p> <div> <pre> http://my.acme.org/cms/en/home/about-us.html</pre> <p> 3) Use case 3: same as 2 (site with multiple lanagues and proper servername) but with SEO-friendly (vanity) URLs. Let&#39;s say for /home/about-us.html page you have a /about</p> <p> You will get the following as a result:&nbsp;</p> <pre> http://my.acme.org/cms/about</pre> <div> Note that we have a rule (can be specified in your module&#39;s rule.drl file) to automatically create SEO-friendly URL mappings, based on the content node title (language-dependent).<br /> <br /> <br /> Now the last, but not the least, the point about &quot;/cms&quot; in the URL, with is preserved right now.<br /> It distinguishes the rendering of content from other &quot;controllers&quot;, like serving files (/files), WebDAV access (/repository) and others.<br /> We have not identified so far a 100% scenario, when we can remove also the &quot;/cms&quot; but still unambiguously re-recrate back the original URL. But we will review it once again, for sure.<br /> It really depends on a particular project, where Jahia is used.<br /> In simple cases, it is possible to also provide a rule to leave /cms out and even remove &quot;.html&quot; from URLs, but it depends on the business constraints and the implementation, selected in templates.<br /> You can easily modify or extend the rewriting rules in the seo-urlrewrite.xml file to meet your project needs. That is why we do not &quot;enforce&quot; those rules by default.<br /> <br /> We will keep you informed on the further evaluation of SEO concepts in Jahia 6.5 and will appreciate any feedback, comments, wishes, bug reports through our Forum (<a href="http://www.jahia.org/forum">http://www.jahia.org/forum</a>) or bug and change request tracking system (<a href="http://jira.jahia.org/">http://jira.jahia.org/</a>).<br /> <br /> Thank you in advance!<br /> <br /> <br /> Kind regards<br /> Sergiy</div> </div> <p> &nbsp;</p>

  • Number of messages  407
    Registration date Jun 7, 2011
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page