[fpc-pascal] Search Engine friendly CGI web apps and pages

Michael Van Canneyt michael at freepascal.org
Tue Jul 13 15:21:09 CEST 2010



On Tue, 13 Jul 2010, Graeme Geldenhuys wrote:

> Hi,
>
> Google and probably most other search engines don't index website that have
> URL's in the following format:
>
>  http://localhost/mycgi?action=myaction
>
> Basically parametrized URL's containing ? or = characters.
>
> What do I need to do in my CGI program to create Search Engine friendly
> URL's? Note that I'm not using some fancy framework like fpWeb, just plain
> old CGI (console type) app.
>
> For example, changing the above URL to something like:
>
>  http://localhost/mycgi/myaction
>
>
> 'mycgi' being the CGI application
> 'myaction' being the parameter passed to the CGI app.
>
>
> My got a custom written (very basic) wiki, which uses the format of the
> first URL show, and would like to change my CGI wiki app to use Search
> Engine friendly URL's so my wiki pages can be indexed by Google.
>
> PS:
> Please note, I'm not really into web development, so sorry if this is a
> dumb sounding question. :)

When using cgi or FastCGI, the PATHINFO environment variable contains the 
/myaction part - in fact, it contains whatever the server finds after the
path to the CGI app.

If you'd do http://localhost/mycgi/myaction/myvariable/myvalue, then
PATHINFO would contain myaction/myvariable/myvalue, and you can then parse
and use that.

fpweb does the same.

Michael.



More information about the fpc-pascal mailing list