Subdomain per section of the content tree?

Author Message

Carlos Revillo

Monday 27 October 2008 4:44:22 am

Hi. This is maybe a following to http://ez.no/developer/forum/setup_design/one_subdomain_per_each_user_blog

I'll try to explain. We have a content tree like

Root
-- News
-- Contact
-- Company
-- Forum
-- Blogs

We want a subdomain for the "blogs" section. something like blogs.domain.com

So, i have added some lines to my site.ini file

HostMatchMapItems[]=blogs.domain;blogs

and i've created a siteaccess called also blogs.
In this new siteaccess i've added override.ini.append.php file and site.ini.append.php with

IndexPage=/content/view/full/5681

All is perfect but my doubts begins now.

we have a main menu template. is a list of the folders under the content tree. usign ezurl operator we get urls like http://www.domain.com/news, http://www.domain.com/company and so on.

But when i go to blogs.domain.com, ezurl operator converts those urls to http://blogs.domain.com/company for example, and this is not what we want.

so, is there any way to keep those urls like http://www.domain.com/company and only the urls of the nodes in "blog tree" displaying urls like http://blogs.domain.com/whatever...

Andrew Duck

Monday 27 October 2008 6:01:31 am

Hi Carlos,

From memory I don't believe ezurl() takes into account the SiteURL setting within the [SiteSettings] block in site.ini. If this is infact the case then the domain name would be based on HTTP_HOST which is an environment variable defined by Apache.

To work around this you would have to customise your menu template and conditionally change those URLs for specific subtrees.

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Andrew Duck

Monday 27 October 2008 6:04:36 am

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators/urls/ezurl

Gaetano mentions this in a comment on the ezurl documentation page. :)

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Carlos Revillo

Monday 27 October 2008 6:10:54 am

I see. And i also have read the comment from Gaetano.

Then we'll need to hack main menu template for this.

Thank you again!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.