Multisite example - Minisite using URL prefix and domain
This page provides two examples of how to create minisites:
Using a shortened URL to use within an existing domain.
Using a sub-domain.
We have content for a minisite that resides deep in the site hierarchy
/comics/belgian-comics/morris/lucky-luke/jolly-jumper. This page
node and its subpages should be served as a minisite.
Assume that there is already a site named site named
mapped to the domain www.best-comics-net,
mapped to the content
/comics. This means requesting the domain with
no further paths returns the rendered page of the node
example - Two sites with different domains.)
Now we look at two solutions for the
The tree below shows the page nodes.
In the following examples we look at the page node
/comics/belgian-comics/morris/lucky-luke/jolly-jumper and its
Keep in mind that this example assumes that the site definition
comics-site already exists. Have a look at the site definition setup
example - Two sites with different domains.
This is the existing
comics-site site definition with an additional
node under mappings:
To get a short URL, we add another node under
<site>/mappings. In this
example, we add the node
||The mapping node name is arbitrary.|
Enables you to access the content at
Maps the content node.
Indicates the JCR workspace of the mapped content.
Now test it: www.best-comics.net/jollyjumper. It works!
In this solution you enable access to the
jolly-jumper minisite using
To do this, you configure a new site definition:
Note that using a distinct site for the minisite means that you can also apply another theme to it. In this example, the jolly-jumper-site uses the jolly-jumper-theme. The jolly-jumper-theme has a CSS that applies a different font (compared to the the comics-theme on the comics-site).
If the new
jolly-jumper-site should reuse items defined on the
comics-site - for instance
templates - you can define the
jolly-jumper-site in a way that it extends the comic-site:
To enable accessing the Magnolia instance with the new subdomain - you must configure your environment accordingly, see mapping multiple domains to the application server.
<VirtualHost *:80> ServerName www.best-comics.net ProxyPass / ajp://localhost:8010/ ProxyPassReverse / ajp://localhost:8010/ </VirtualHost> <VirtualHost *:80> ServerName www.best-vinyl.net ProxyPass / ajp://localhost:8010/ ProxyPassReverse / ajp://localhost:8010/ </VirtualHost> <VirtualHost *:80> ServerName jollyjumper.best-comics.net ProxyPass / ajp://localhost:8010/ ProxyPassReverse / ajp://localhost:8010/ </VirtualHost>
Now try to access jollyjumper.best-comics.net. It works!