rename tag www to lighttpd, finish article

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-06-22 23:07:01 +02:00
parent bc5e8a77bf
commit a4e7daa356
3 changed files with 67 additions and 4 deletions

View file

@ -0,0 +1,63 @@
[[!meta title="Mixing redirects and rewrites with lighttpd and Plone"]]
## The situation
As you may already know,
[[I am|blog/restart-to-write-news]]
[[migrating|blog/migration-1-configs]]
[[many of|migration-2-freebsd-raid-monitoring-foss]]
[[my websites|migration-3-ccollect]] into this one.
Today I also began to redirect stuff from my
previous personal website, http://nico.schottelius.org.
I am (still) running [Plone](http://www.plone.org) on that
site, behind [lighttpd](http://www.lighttpd.net/). The
configuration of lighttpd looks like this:
$HTTP["host"] =~ "^(nico|nico2)\.schottelius\.org$" {
url.rewrite-once = ( "^/(.*)" => "/VirtualHostBase/http/nico.schottelius.org/cms/VirtualHostRoot/$1" )
var.logdir = "/home/server/www/nico/nico.schottelius.org/logs/"
accesslog.filename = logdir + "access.log"
proxy.server = ( "" => (
( "host" => "192.168.6.2", "port" => 8082 ),
( "host" => "192.168.6.2", "port" => 8083 )
))
}
([[a more detailled version can be found here|configs/lighttpd-zope-http-and-https]])
Now I created a new [[about page here|about]] and want to redirect
the old URLs **"^/ueber/nico-schottelius$"** and **"^/about/nico-schottelius$"**
from the Plone site to it.
First I tried the normal redirect like this:
url.redirect = ( "^/ueber/nico-schottelius$" => "http://www.nico.schottelius.org/about/",
"^/about/nico-schottelius$" => "http://www.nico.schottelius.org/about/" )
Unfortunately, this did not work. You may already have spotted the bug...
The correct way to redirect pages from lighttpd in front of
[Zope](http://www.zope.org), which does ***rewriting*** is to match on the
**rewritten** path! Thus, the following code does the
[correct redirect](http://nico.schottelius.org/about/nico-schottelius):
url.redirect = (
"^/VirtualHostBase/http/nico.schottelius.org/cms/VirtualHostRoot/ueber/nico-schottelius$"
=> "http://www.nico.schottelius.org/about/",
"^/VirtualHostBase/http/nico.schottelius.org/cms/VirtualHostRoot/about/nico-schottelius$"
=> "http://www.nico.schottelius.org/about/"
)
You can use [curl](http://curl.haxx.se) to verify the redirect:
[22:54] ikn% curl -i http://nico.schottelius.org/about/nico-schottelius
HTTP/1.1 301 Moved Permanently
Location: http://www.nico.schottelius.org/about/
Content-Length: 0
Date: Mon, 22 Jun 2009 21:01:39 GMT
Server: lighttpd/1.4.19
[[!tag lighttpd plone]]

4
tags/lighttpd.mdwn Normal file
View file

@ -0,0 +1,4 @@
[Lighttpd](http://www.lighttpd.net)
related stuff.
[[!inline pages="tagged(lighttpd)" archive="yes" show=0]]

View file

@ -1,4 +0,0 @@
[web](http://en.wikipedia.org/wiki/Www)
related stuff. Webservers, websites, etc.
[[!inline pages="tagged(www)" archive="yes" show=0]]