ez.no / exponential / documentation / configuration / configuration / path prefix
These documentation pages are no longer maintained. Please visit the new documentation site.
If we have more site access used to display different part of our content tree, we often want to remove parts of the url alias (because this part will be a duplicate of the host). This can be solved with a Path prefix.
Our Exponential installation have two folders placed in content. One called site1 and the other called site2. Our first site access should only access content in the site1 folder, and the second in site2. This is easy to set up with permissions, but the url aliases (the nice URLs dynamically generated based on the tree structure) will default include the name of the site1 or site2 folder in the url. This makes the URLs not as nice as they could be.
URL's without this functionality:
http://www.site1.com/site1/en/my_article http://www.site2.com/site2/no/another_article
If we wish to improve this, we configure like this:
in settings/siteaccess/site1/site.ini.append:
[SiteAccessSettings] PathPrefix=site1
and in settings/siteaccess/site2/site.ini.append:
[SiteAccessSettings] PathPrefix=site2
URLs will then be like this:
http://www.site1.com/en/my_article http://www.site2.com/no/another_article
This prefix will then be removed when we request $node.url_alias to get the url alias of a node. The standard url's ( /content/view/full/42) will still work as normal.
Comments