<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=KOI8-R" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Igor Sysoev wrote:<br>
<blockquote cite="mid:20080217174047.GA7304@rambler-co.ru" type="cite">
<blockquote type="cite">
<pre wrap="">later. I want to use something like this:
if (-f $document_root/$uri)
</pre>
</blockquote>
<pre wrap=""><!---->
You should use $request_filename instead: - it's "$document_root$uri".
However, $request_filename correctly handle "root" as "alias".
</pre>
</blockquote>
I'm looking for a flavor of $request_filename that includes query
arguments, so that I can cache a version of the page that includes the
arguments. At the very least, I need to differentiate between a version
WITH arguments and a version WITHOUT arguments. I don't want those two
requests to serve up the same page. This is very important for SEO
purposes, to avoid duplicate content being shown at two different urls.<br>
<br>
I could use this:<br>
<br>
if (-f $document_root/$request_uri)<br>
<br>
But there are escaping issues. Perhaps nginx needs something like this:<br>
<br>
$request_filename_with_args<br>
<br>
<br>
<blockquote cite="mid:20080217174047.GA7304@rambler-co.ru" type="cite">
<blockquote type="cite">
<pre wrap="">2) Can I URL encode a variable?
</pre>
</blockquote>
<pre wrap=""><!---->
I do not understand the question.
</pre>
</blockquote>
Another solution to my problem would be something like:<br>
<br>
set $path url_escape($request_uri)<br>
if (-f $document_root/$path) {<br>
š ...<br>
<br>
Adam<br>
</body>
</html>