[Lazarus] EmbWeb: Moving between webapp type caveats

ABorka fpc-devel at aborka.com
Mon Jun 13 20:21:54 CEST 2011


> Back to the problem, using relative URL is not a solution as well. When I do
> http://localhost/proj/proj.cgi/module/action then if somewhere I put
> public/style/style.css then the link becomes:
> http://localhost/proj/proj.cgi/module/public/style/style.css, regardless of
> the webapp type (at least on Chrome, don't know about other browsers). Isn't
> there really a way somehow?

Because you need
/public/style/style.css
indicating that it is a static file from the virtual path starting from 
document root.
public/style/style.css
is relative from the current virtual path, which can be anything 
physically in the file system, depending on the OS or weather you use 
CGI or Apache module, etc.
Also, if your CGI program opens files, it will need full physical paths, 
we can not use relative paths with it either, because it can be the main 
root dir on Linux or the Apache main dir (not the document root) on 
Windows. Usually not the physical path the CGI program resides in.

AB





More information about the Lazarus mailing list