As I'm not good at English, I don't understand what this quote from RFC 3875 means.
For any particular request, the server will identify all or a leading part of this path with an individual script, thus placing the script at a particular point in the path hierarchy.
To me, it is interpreted as:
- The server will find out all or a leading part of the path, using an individual script (what does that even mean?).
- The server will create or move the script to somewhere (isn't that what 'placing' means?).
which doesn't make sense at all.
Also, I don't understand what 'path hierarchy' means here.
It will be grateful if someone can explain these with examples.
You may think stack overflow is inappropriate place to ask this kind of question because this is about English, not coding, but I couldn't really find better place to ask because it requires knowledge about CGI to answer this question.
Also, the answer would be an elaborated explanation about CGI, so I think it will be helpful to other people who want to learn about CGI.
CodePudding user response:
The "path hierarchy" is refers to the directory structure in the path. In other words the segments separated by slashes. So in the path /main/sub/foo
"main" is the main directory, "sub" is a sub-directory, and "foo" is a file name. These ordered path segments are what is called a hierarchy. The segments at the beginning (the left) are the most important (highest in the hierarchy.) The web server will check the path segments one at a time from left to right to try to find the CGI script that they specify.
When identifying which CGI script to use, if the request is for /some/directory/script.cgi/additional/path/info
and the file /some/directory/script.cgi
exists, then the webserver would use that CGI file for the request. That example shows that the file doesn't have to match the full path, just the "leading part" or "prefix" of the path.
The additional path segments after the name of the script file are effectively ignored, at least for the process of identifying which file should be used to power the request. The entire path including /additional/path/info
is available to the CGI script and it can use them to determine what content to show.
The CGI subsystem of the web server never moves scripts around. I think you would find it clearer if that were phrased as "The web server may find the CGI script placed at any point in the path hierarchy, including the beginning or the middle, rather than always at the end."