You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andreas Neuenschwander <an...@andi.ch> on 2000/11/13 22:10:37 UTC

Different Stylesheets for different Domains with C1

Hello Everyone,

I'd like to do the following:

www.domain1.com/index.xml

www.domain2.com/index.xml

In case that www.domain1.com and www.domain2.com are virtual servers.

Both url's points to the same index.xml file on the webserver.
But the .html output from Cocoon uses different stylesheets depending
on the requesting domain.

Does anybody know how to do this with C1?


I Know that I could do it with a query parameter like this:

www.domain1.com/index.html?stylesheet=domain1.xsl
www.domain2.com/index.html?stylesheet=domain2.xsl

But that's really not how I'd like to do it.

Is there such a feature in C1? (I couldn't find it, but this could
be a useful feature)


Any hints, comments?


- Andi




Re: Different Stylesheets for different Domains with C1

Posted by Tony DeBat <td...@personification.com>.
On Mon, 13 Nov 2000, Andreas Neuenschwander wrote:

> Hello Everyone,
> 
> I'd like to do the following:
> 
> www.domain1.com/index.xml
> 
> www.domain2.com/index.xml
> 
> In case that www.domain1.com and www.domain2.com are virtual servers.
> 
> Both url's points to the same index.xml file on the webserver.
> But the .html output from Cocoon uses different stylesheets depending
> on the requesting domain.
> 
> Does anybody know how to do this with C1?
> 
> 
> I Know that I could do it with a query parameter like this:
> 
> www.domain1.com/index.html?stylesheet=domain1.xsl
> www.domain2.com/index.html?stylesheet=domain2.xsl
> 
> But that's really not how I'd like to do it.
> 
> Is there such a feature in C1? (I couldn't find it, but this could
> be a useful feature)
> 
> 
> Any hints, comments?

I'm currently testing (and am successfully working with) such a setup:

In my apache httpd.conf I've got the following virtual host configuration:

<VirtualHost 192.168.0.92>
ServerName domain1.personification.com
DocumentRoot /home/httpd/domain1/html
ScriptAlias /cgi-bin/ /home/httpd/domain1/cgi-bin/
</VirtualHost>

<VirtualHost 192.168.0.92>
ServerName domain2.personification.com
DocumentRoot /home/httpd/domain2/html
ScriptAlias /cgi-bin/ /home/httpd/domain2/cgi-bin/
</VirtualHost>

Inside the DocumentRoot of each virtual domain I've got an "xml" directory
like so:

/home/httpd/domain1/html/xml/
/home/httpd/domain2/html/xml/

Inside each of these "xml" directories is a symbolic link to a common
"index.xml" file.

lrwxrwxrwx    1 root     root           29 Nov 13 16:33 index.xml ->
/home/tdebat/cocoon/index.xml

The "index.xml" file contains the following directive.

<?xml-stylesheet href="../xsl/index.html.xsl" type="text/xsl"?>

Inside the DocumentRoot of each virtual domain I've got a symbolically
linked "xsl" directory. So inside of the directory

/home/httpd/domain1/html/

I've got the link

lrwxrwxrwx    1 root     root           28 Nov 13 16:36 xsl ->
/home/tdebat/cocoon/domain1/

And inside the directory 

/home/httpd/domain2/html/

I've got the link

lrwxrwxrwx    1 root     root           28 Nov 13 16:36 xsl ->
/home/tdebat/cocoon/domain2/


The directories "/home/tdebat/cocoon/domain1/" and
"/home/tdebat/cocoon/domain2/" contain different versions of the file
"index.html.xsl", allowing different output to be produced from the same
xml file when it is hit from different domains.


I'm using Cocoon 1.7.4 running on Linux (RH6.2).