rewrite url

How to generate absolute links?


A remote site must integrate a content view using AJAX. The various links inside the HTML produced must be absolute and not relative because of this


The only solution is to use URL Rewrite. Jahia implements Tuckey. For syntax please check

To find where to place and name the XML containing the rewrite rules:

Here is an example of urlrewrite.xml that did the trick for this ticket:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-// UrlRewrite 3.2//EN"

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

Every links without // will be prefixed with protocol://server-name:port/
Some restrictions and conditions must be added to this rule as it currently acts for the whole Jahia content.