[Lazarus] fpWeb and dynamic path_info

Michael Van Canneyt michael at freepascal.org
Sat Nov 6 20:30:11 CET 2010



On Sat, 6 Nov 2010, ik wrote:

> Hello,
> 
> I'm trying to learn how to use fpWeb, and I wish to implement (for the learning) my web site (http://www.linesip.com). If you follow the links, you will find links
> such as:
> /he/servcies/smartpbx etc...
> 
> The "he" part is actually dynamic and can be set to other languages (in the feature) and it exists for mostly search engines.
> How can I create such dynamic path_info using fpWeb ?

It is actually inverse to how fpweb works. The first 2 elements of the path determine the functionality,
I would expect the last part to determine the language.

The best way to deal with this is probably to use the OnGetModule event of TCustomWebApplication 
and examine and possibly 'cut' the first part off (use getnextpathinfo to cut it off), and save 
it in some temporary request variable (you can append it to TRequest).

If the OnGetModule returns Nil, normal fpwebprocessing will occur to determine the actual module that must be invoked.

Michael.




More information about the Lazarus mailing list