There’s plenty of good documentation on how to setup Zope/Plone with Apache but I got stumped on how to serve up Plone and Apache-based content simultaneously. Along with other directories, I wanted to serve up each user’s web directory (/home/user/public_html). Of course it was obvious in hind-sight, but I spent a while racking my brain. Assuming you have the UserDir option and cgi-bin directories setup all you have to add are the following lines, including the line to for the Virtual Host Monster:
RewriteCond %{REQUEST_URI} !^/cgi-bin/(.*)
RewriteCond %{REQUEST_URI} !^/~(.*)
RewriteRule ^/(.*) \
http://127.0.0.1:8080/VirtualHostBase/http/%{HTTP_HOST}:80/site/VirtualHostRoot/$1 [P]
The first two lines catch any requests for the cgi-bin directory or a user’s directory before the VHM rewrites the URLs. If any other directories need to be served up just add the appropriate line before the last one.
Filed under: Sysadmin