[opencms-dev] New/better solution for generating nice URLs?

Roman Uhlig roman.uhlig at knve.de
Tue Jun 2 16:12:57 CEST 2009


Thanks to your help we got it working. Up to now we had no problems with this
configuration. And there's no need to install OpenCms as root webapp. Here
is our setup (tho I'm sure there are other ways):

Apache httpd 2.2.10
Tomcat 6.0.18
OpenCms 7.0.5

1. Tomcat is accessed through Apache httpd ajp

2a. virtual host rewrite:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/opencms/opencms/?.*
RewriteCond %{REQUEST_URI} !^/opencms/export/?.*
RewriteCond %{REQUEST_URI} !^/opencms/resources/?.*
RewriteCond %{REQUEST_URI} !^/opencms/webdav/?.*
RewriteRule (.*)$ /opencms/opencms%{REQUEST_URI} [PT]

2b. virtual host proxy

<Proxy ajp://localhost:8009*>
  Allow from all
</Proxy>

ProxyPass        /opencms/   ajp://localhost:8009/opencms/
ProxyPassReverse /opencms/   ajp://localhost:8009/opencms/

ProxyPass /          ajp://localhost:8009/opencms/opencms/
ProxyPassReverse /   ajp://localhost:8009/opencms/opencms/

--> we use 2a, since it's more lightweight and creates less server load, but
in our tests both versions worked well

3. The root of the website resides in /sites/, e.g. /sites/mysite

The according config in opencms-system.xml:

<sites>
  ...
  <site server="www.mysite.com" uri="/sites/mysite/" />
</sites>

4. Change VFS-Prefix

The according config in opencms-importexport.xml:

<vfs-prefix></vfs-prefix>

--> we removed CONTEXT_NAME as well as SERVLET_NAME for having no "opencms"
in the URI


That's it. Up to now we had no problems, but if there are pitfalls we might
have missed, we appreciate any hints. Basically that's not much different
from Sebastians updated approach for OpenCms 7, but includes the elimination
of one more path level in the URI. This way we transformed

http://www.mysite.com/opencms/opencms/mysite/en/index.jsp

into

http://www.mysite.com/en/index.jsp


Roman

-- 
View this message in context: http://www.nabble.com/New-better-solution-for-generating-nice-URLs--tp23722232p23833327.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list