Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Why are their two build paths in setup?

Quote Reply
Why are their two build paths in setup?
Does anybody know why there are 2 build paths?

build_root_url
build_root_path

If you want to use relative URL's, that is you don't want the hostname appended to every single tag on the template-generated page, should you set build_root_url to '/'? It seems very wasteful to use absolute url's, especially if your page is already very large.




Quote Reply
Re: [scorpioncapital] Why are their two build paths in setup? In reply to
Hi;

The cgi can not "guess" the actual path on the servers' hard drive, due to OS and server setup differences - it must be told, therefore the "build_root_path". The build_root_url is the Web Address (www.cnn.com/news), which is totally different from the build address.
Quote Reply
Re: [scorpioncapital] Why are their two build paths in setup? In reply to
>>>Does anybody know why there are 2 build paths? <<<

They are not both paths. One is a URL, and the other is a path.... Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Why are their two build paths in setup? In reply to
Thanks, so the URL is the one that is replaced when the globals are called in the templates? In that case I suppose this should give relative URL's throughout your project and still work:

build_url = '/'
build_path = '/home/htdocs/mysite/'
Quote Reply
Re: [scorpioncapital] Why are their two build paths in setup? In reply to
No.... not exactly.

The build URL is the path you want your pages built in. It's not the "home" url. It's the URL page.cgi uses to determine where the build_path built the static pages -- or would have. It's the URL to the build_path, and the logical top of the Links directory.

This should not PHYSICALLY map onto the top of your server directory, which is why it's suggested to use Links or Links/Pages as the place to put the directory.

There have been numerous warnings about using "/" (the root server directory) as the build path. It's a security hole, at the very least. Always use a subdirectory, then use redirects, .htaccess files or even symlinks to alias your root URL (http://servername.com) to the subdirectory. You really don't want your root directory writable by world, or the server.

The build path, is the path to the url used above, where the actual pages are built by build.pm. You access this physical path via the webserver using the build_URL.

Another way to look at this is that the URL is how the webserver knows where the physical server built the pages. When you want to get to your system via the web (as admin or as user) you need an http:// path. When the programs are running on the server, they do not know about http:// paths, but need a physical, absolute (or relative) path to follow on the file system.

Hope this helps, but might just have added to the confusion ;)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.