[opencms-dev] overriding links as internal

Jack Bakker jbakker at iable.ca
Thu Jan 15 17:50:17 CET 2009


Hello Christian,

Building your idea, I've discovered a way which works for me:

For www.site1.com I use apache/mod_jk/tomcat and have static content
delivered only through apache with:

<VirtualHost *:80>
    	ServerName www.site1.com
	SetEnvIfNoCase Request_URI ^/static/.*$ no-jk
	...(fancier Rewrite stuff here to eliminate /opencms/opencms, modify
for other servlets (dwr, struts), etc.)...
</VirtualHost>

--

New following your idea is an additional virtual host for site1.com

<VirtualHost *:80>
    	ServerName site1.com
	RedirectMatch ^/(?!static)(.*) http://www.site1.com/$1
	DocumentRoot /home/site1/www
</VirtualHost>

for regex learning, I found this useful:
http://www.regular-expressions.info/lookaround.html

--

the above redirects http://site1.com to http://www.site1.com except if the
request is http://site1.com/static/* in which case it just looks at
/home/site1/www/static for content

thanks for the lead on the idea

................
Jack Bakker 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of 
> Christian Steinert
> Sent: Wednesday, January 14, 2009 4:52 PM
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] overriding links as internal
> 
> Dear Jack
> 
> This has also hit me (but with links that I used in a regular 
> html page - no matter whether I used the fckeditor or edited 
> the HTML source code).
> The workaround that I used was to use a slightly different 
> domain name for links that should not be rewritten by 
> opencms: instead of linking to http://www.foo.com/bar/baz 
> (with www.foo.com being the domain that is configured with 
> opencms), I linked to http://foo.com/bar/baz. That may be a 
> bit of a hack but keeps the link untouched, at least in the 
> cms editor.
> 
> hth
> best regards
> Christian
> 
> > I am fetching an opencms html file for in an email body and 
> don't want 
> > http://www.site1.com/ replaced with /site1/ and don't want 
> the link to 
> > have the attribute internal="true"
> > 
> > however, even after editing the controlcode directly to 
> what I want, 
> > when I save it still happens, http://www.site1.com/ gets 
> replaced with 
> > /site1/ and the link attribute internal gets set to "true"
> > 
> > is there a way of overriding this behavior so I can force 
> an abolute 
> > instead of relative URL ?
> > 
> > 
> > 
> > ................
> > Jack Bakker
> > 
> > 
> > _______________________________________________
> > This mail is sent to you from the opencms-dev mailing list 
> To change 
> > your list options, or to unsubscribe from the list, please visit 
> > http://lists.opencms.org/mailman/listinfo/opencms-dev
> > 
> 
> 
> __________________________________________________________________
> Deutschlands größte Online-Videothek schenkt Ihnen 12.000 
> Videos!* 
> http://entertainment.web.de/de/entertainment/maxdome/index.html
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list To 
> change your list options, or to unsubscribe from the list, 
> please visit http://lists.opencms.org/mailman/listinfo/opencms-dev
> 




More information about the opencms-dev mailing list