httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: svn commit: r832217 - in /httpd/httpd/trunk/docs/manual/rewrite: index.html.en index.xml index.xml.tr remapping.html.en remapping.xml rewrite_guide.html.en rewrite_guide.xml
Date Wed, 04 Nov 2009 19:00:54 GMT
On Wed, Nov 4, 2009 at 1:19 PM, Rich Bowen <rbowen@rcbowen.com> wrote:
> Will this fix it? :
>
>
> @@ -177,11 +177,14 @@
>  #   backward compatibility ruleset for
>  #   rewriting document.html to document.php
>  #   when and only when document.php exists
> +&lt;Directory /var/www/htdocs&gt;
>  RewriteEngine on
> +RewriteBase /var/www/htdocs
>
>  RewriteCond $1.php -f
>  RewriteCond $1.html !-f
> -RewriteRule ^(.*).html$ $1.php
> +RewriteRule ^(.*).html$ $1.php
> +&lt;/Directory&gt;
>  </pre></example>
>     </dd>

RewriteBase is the URL-path, not the filesystem path.  And I don't
think test strings in a condition are expanded with respect to the
base.

You can figure out where the first pass landed by using
%{REQUEST_FILENAME} in per-dir context:

Alias /a /tmp/a
<directory /tmp/a>
RewriteBase /a
RewriteEngine on
# full path in per-directory contet
RewriteCond %{REQUEST_FILENAME} (.*)\.html$
RewriteCond %1.php -f
RewriteRule (.*)\.html$ $1.php
</directory>


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message