Thursday 03 June 2004 2:41:41 pm
Hi there,
I'm curently setting up a single eZ publish installation with multiple domains. In fact it is pretty easy to do, while using "host" as "MatchOrder" in section "[SiteAccessSettings]" in your "site.ini". I you do so you are able to use a completly different siteaccess for each of your domains (and/or subdomains). I will give a simple example:
Let's say we have 3 domains an 2 subdomains:
www.companyname.com (your company website)
www.cool-product.com (a special product of your company) www.community.net (a community run by your company)
admin.companyname.com (control your sites) root.company.com (the root of all your websites) What we want is that each of these domains point to the same html-dir on the webserver. This is because we don't want things like "companyname.com/site1/index.php/..." or "cool-product.com/index.php/siteaccess/module_stuff/...".
What to do to make that work:
-Configure your server that evry domains points to the SAME directory on your webserver
-Configure your eZp and make a first website work (eg. company.com)
-Don't put any content on your new site and make sure you are using your own siteaccess
-Use your own design!!! (never touch "standard" designs in eZp - it's the Fallback-Design and not something to adapt!)
-remeber to set these settings correct:
--StandardDesign=standard
--SiteDesign= --AdditionalSiteDesignList[]= If your sites have a corporate design I recommend that you use a design called "default" (or "corporate", but not "companyname") and override specific things with an design called "companyname" or "coolproduct". Make use of the "AdditionalSiteDesignList[]"-Array and siteaccesses! If you have completly different looking site you don't need to do that - just use different siteaccesses...
Now to the domain-setup-thing:
First we need to create siteaccesses for your domains. As long as we want each of your domains point to another content (and/or design) in ezp we need to create a specific siteacces for each of our domains. I think you know how to handle siteaccesses - if you don't, remeber that our ""settings/siteacces/somename"-folder can override every setting in every file in "/settings". If we want to set a different design, create a site.ini in your "/settings/siteaccess/somename/-folder an write:
[DesignSettings] SiteDesign=somedesign
If you want to have a different start- and/or default-page for your siteaccess (later for your domain):
[SiteSettings]
IndexPage=/content/view/full/2057/ DefaultPage=/content/view/full/2066/ Just search the ini-files for the entries you want to override (eg. an other language)...
Now we go on with the correct setup for your domains in ezp: After we setup all of our siteaccesses and designs and configuration we just link a domain or subdomain to a siteaccess. Just do a configuration like this: [SiteAccessSettings] (...)
# A list over current active siteaccesses
AvailableSiteAccessList[]=admin
AvailableSiteAccessList[]=companyname
AvailableSiteAccessList[]=coolproduct
AvailableSiteAccessList[]=community AvailableSiteAccessList[]=plain (...)
# An array of access types which are tried, possible entries are: host, index, uri and port MatchOrder=host (...) HostMatchType=map (...)
HostMatchMapItems[]=companyname.com;companyname
HostMatchMapItems[]=www.companyname.com;companyname
HostMatchMapItems[]=coolproduct.com;coolproduct
HostMatchMapItems[]=www.coolproduct.com;coolproduct
HostMatchMapItems[]=community.net;community
HostMatchMapItems[]=www.community.net;community HostMatchMapItems[]=admin.companyname.com;admin The first of the HostMatchMapItems is your domain (subdomain), the second the siteaccess that will be used. There is no more need for the "/index.php/siteacces/module_stuff", since is now "companyname.com/index.php/module_stuff" (or siteaccess.companyname.com/...).
If you set
MatchOrder=host
to
MatchOrder=host;uri you will be able to make use of both ways to open a siteaccess. But note: It's not possible to add a siteaccess in the "index.php/siteaccess"-style if your domain is listed in HostMatchMapItems[]. If you want to use this style I suggest you create a subdomain (e.g, root.companyname.com), point it to the same html-dir as the other domains and do NOT add it to HostMatchMapItems[]. ezp will now use the uri-style, because it can find a matching host-style entry. You see. It's pretty easy to set up a single installation with multiple sites on it. It's a bit tricky to manage your content later - I suggest something like the domainnames on the root folder (nodeID 2) - if you want to seperate the content. And you should use sections and specific override-template-rules if your sites have different layouts (otherwise it would be possible to get content from community.net on companyname.com - if someone knows the specific nodeIDs. But that's an other problem and needs some thinkink about how to setup the site... Hope you understood my "english" and I could help you. If there are any questions left just contact me: ich@daniel-beyer.com (if I don't answer you, mail again some days later - I have my domain on transfer to a new server and I'm sure it will go offline because of that ;-)
Daniel Beyer
_________________________________
YMC AG
Kreuzlingen, Switzerland
web: www.ymc.ch
____________________________________
|