[opencms-dev] where is "create sibling"

] Code Create [ ocms at code-create.de
Sat Feb 28 13:40:23 CET 2015


My opencms runs below ROOT too
I have currently six sites in that installation.
One is multiple language.
Nowhere there is a need for permanent redirect, at least not for your
reasons.
It's all done via rewrites in the different (sic!) vHosts.
I never liked this apache mod_proxy thing.

If you have both sites in one vHost you can nevertheless check the
incoming domain, and rewrite accordingly.

Give mod_jk a try, it's simple, cool and fast . Why bother with port
numbers .

Regarding your running system. You do not have a 1:1 offline version of
your whole installation for development and testing?


I do use something like this apache-wise. It's just a simple example, my
vHost is much more complex.

<VirtualHost xxx.xxx.xxx.xxx:xx>

 	ServerName www.whatever.de
     	
	DocumentRoot "/srv/tomcat/webapps/ROOT/"
    	
	SetEnvIf Request_URI
(\.js|\.css|\.gif|\.jpg|\.png|\.ico|\.mp4|\.ogv|\.webm|\.txt)$ direct

	#Do what ever stuff you like to do here

	<Directory "/srv/tomcat/webapps/ROOT/">
		AllowOverride None
		Order Allow,Deny
		Allow from all
	</Directory>

	RewriteEngine on
	
	#Do what ever rewrites you like to do here

	RewriteCond %{ENV:direct} 1
	RewriteCond /srv/tomcat/webapps/ROOT%{REQUEST_FILENAME} -f
	RewriteRule .* - [env=no-jk,L]
	RewriteCond %{ENV:direct} 1
	RewriteRule ^/export/(.*)$ - [PT]

	#Do what ever rewrites you like to do here

	RewriteRule ^/resources/(.*)$ - [PT]
	RewriteRule !^/opencms/(.*)$ /opencms%{REQUEST_URI} [PT]

	JkMount /*            ajp13
	JkMount /opencms/*    ajp13
	JkMount /export/*     ajp13
	JkMount /resources/*  ajp13
	
</VirtualHost>

Am 28.02.2015 um 11:47 schrieb Christoph P.U. Kukulies:
> Am 27.02.2015 um 18:41 schrieb ] Code Create [:
>> Why "once again" ? :)
>> In your ".com" vHost you rewrite internally to your /en/ folder and in
>> your ".de" vHost you rewrite internally to your /de/ folder.
>>
>> That apart, I don't understand your /opencms/ to
>> http://www.mysite.whatever/ permanent redirects. Seems like an endless
>> loop if that happens inside a www.mysite.whatever vHost?!
> 
> For one, my site is in /ROOT. Second, I got this (very old) recipe from
> https://opencms.cse.unsw.edu.au/alkacon-documentation/howto_apache_httpd/mod_proxy.html
> 
> (See Step 4)
> OK. Anyway thanks for your suggestions. Will  try to augment the
> rewriting and mapping that way. Only at the moment I cannot touch a
> running system :)
> 
> I have one site that has one vHost section for both with a
> ServerName www.mysite.de
> ServerAlias www.mysite.com
> 
> For this configuration your suggestion would not work, would it?
> 
> Every vHost Section uses its own port connector.
> 
> 
>  Am 27.02.2015 um 16:35 schrieb Christoph Kukulies:
>>> Am 27.02.2015 um 16:09 schrieb ] Code Create [:
>>>> Hi Christoph,
>>>>
>>>> why do you do the redirect at all?
>>>> You're already differentiating by TLD.
>>>> Why not just rewrite internally to your /de/ and /en/ folders via
>>>> Apache?
>>>>
>>>> Kind regards, Bernd
>>>>
>>>>
>>> Good question. Maybe historically reasoned. My site is in ROOT and I'm
>>> doing the rewrite rules in two VirtualHost sections, one for mysite.com,
>>> the other for mysite.de. The former
>>> does
>>>
>>>   RedirectPermanent /opencms/           http://www.mysite.com/
>>>
>>> the latter
>>>
>>>   RedirectPermanent /opencms/           http://www.mysite.de/
>>>
>>> In opencms-system.xml I have
>>>
>>>   <site server="http://www.mysite.de" uri="/sites/mysite/"/>
>>>   <site server="http://www.mysite.com" uri="/sites/mysite/"/>
>>>
>>> So I will have to decide once again, where the request is redirected to.
>>>
>>> Or do you have a better suggestion?
>>>
>>>
>>>
> 
> 



More information about the opencms-dev mailing list