Apache2-Translation
view release on metacpan or search on metacpan
HTTP code of 301 (MOVED PERMANENTLY) to "http://xyz.com/static/img.png".
When the redirected request comes back the condition in record 1 is
false. Hence, the next block (key=front, uri=:PRE:, blk=1) is evaluated.
First a "lang" member of a context hash is set to "en". A "Do" action is
similar to a condition, only its value is ignored. Record 4 then checks
if the "Host" header matches "/de$/". If so, then record 5 sets the
*language* to "de".
Now, the records labeled with ":PRE:" are finished. The handler starts
looking for blocks labeled with the request uri. That is, it looks for a
block with key=front, uri=/static/img.png. None is found.
Then it cuts off the last part of the uri (/img.png), repeats the lookup
and finds record 6. The "File" action sets "$r->filename" to
"$DOCROOT/en/img.png". "Apache2::Translation" provides some convenience
variables. They are tied to members of the request record.
$MATCHED_PATH_INFO contains the uri part cut off ("/img.png"). More on
them below.
Now another round is started and the next uri part is cut off. Record 9
different directives. "PidFile" is clearly applied during server
startup before any request is processed. Hence, our "Config" action
cannot apply "PidFile". It's simply too late. "AllowOverride" is
applied to single requests. But since it affects the processing of
".htaccess" files it must be applied before that processing takes
place. To make things even more confusing some directives take
effect at several points in time. Consider
Options FollowSymLinks ExecCGI
"FollowSymLinks" is applied when Apache looks up a file in the file
system, while "ExecCGI" influences the way the response is generated
ages later.
Apache solves this complexity by computing a configuration for each
single request. As a starting point it uses the server default
configuration. That is the configuration outside any "Location" or
"Directory" for a virtual host. This basic configuration is assigned
to the request just between the *Uri Translation Phase* and *Map to
Storage*. At the very end of *Map to Storage* Apache's core *Map to
Storage* handler incorporates matching "Directory" containers and
lib/Apache2/Translation.pod view on Meta::CPAN
HTTP code of 301 (MOVED PERMANENTLY) to C<http://xyz.com/static/img.png>.
When the redirected request comes back the condition in record 1 is
false. Hence, the next block (key=front, uri=:PRE:, blk=1) is evaluated.
First a C<lang> member of a context hash is set to C<en>. A C<Do> action
is similar to a condition, only its value is ignored. Record 4 then
checks if the C<Host> header matches C</de$/>. If so, then record 5 sets
the I<language> to C<de>.
Now, the records labeled with C<:PRE:> are finished. The handler starts
looking for blocks labeled with the request uri. That is, it looks
for a block with key=front, uri=/static/img.png. None is found.
Then it cuts off the last part of the uri (/img.png), repeats the
lookup and finds record 6. The C<File> action sets C<$r-E<gt>filename> to
C<$DOCROOT/en/img.png>. C<Apache2::Translation> provides some convenience
variables. They are tied to members of the request record.
C<$MATCHED_PATH_INFO> contains the uri part cut off
(C</img.png>). More on them below.
Now another round is started and the next uri part is cut off. Record 9
lib/Apache2/Translation.pod view on Meta::CPAN
Also, the point in time when a directive takes effect differs for different
directives. C<PidFile> is clearly applied during server startup before
any request is processed. Hence, our C<Config> action cannot apply C<PidFile>.
It's simply too late. C<AllowOverride> is applied to single requests.
But since it affects the processing of C<.htaccess> files it must be applied
before that processing takes place. To make things even more confusing some
directives take effect at several points in time. Consider
Options FollowSymLinks ExecCGI
C<FollowSymLinks> is applied when Apache looks up a file in the file system,
while C<ExecCGI> influences the way the response is generated ages later.
Apache solves this complexity by computing a configuration for each single
request. As a starting point it uses the server default configuration. That
is the configuration outside any C<Location> or C<Directory> for a
virtual host. This basic configuration is assigned to the request just
between the I<Uri Translation Phase> and I<Map to Storage>. At the very
end of I<Map to Storage> Apache's core I<Map to Storage> handler incorporates
matching C<Directory> containers and C<.htaccess> files into the request's
current configuration. C<Location> containers are merged after
( run in 0.511 second using v1.01-cache-2.11-cpan-64827b87656 )