On Jul 22, 2009, at 10:27 AM, Torsten Foertsch wrote:

If you want, it's actually possible to take this even further and remove rewrite completely.

<Location /etexts/id/>
  SetHandler perl-script
  PerlHandler Apache2::Alex::SemanticWeb
</Location>

Then alter your handler's code to parse $r->uri and extract
everything after $r->location. (or you can use $r->path_info, if the
/etexts/id/ actually exists in your document root).  That'll give you
the same thing that rewrite is currently stuffing into your id
argument.

Never use path_info unless you are very sure it is what you want.
Path_info is made for CGI scripts where $r->filename points to the file
containing the script....

substr($r->uri, length $r->location) is almost always what you need.


These two things represent a very elegant solution that I have already implemented. Cool. Thanks!

--
Eric Lease Morgan

Reply via email to