httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yvand <yvand.sw...@gmail.com>
Subject Re: [users@httpd] Issue with URL Rewriting
Date Tue, 09 Jul 2013 14:12:47 GMT
Thank you Vincenzo D'Amore for helping me.

> It is quite weird... In your log it seems there isn't the rewritecond 
> part...
> Which rewriteloglevel have you enabled?
I used rewriteloglevel 3.
I changed it to 8 and noticed that it doesn't match as I expected !


With this htaccess :
> RewriteEngine On
> RewriteCond /pictures/%{REQUEST_FILENAME} -f
> RewriteRule ^(.+) /pictures/$1 [L]
I got :
> 127.0.0.1 - - [09/Jul/2013:16:04:36 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (3) [perdir 
> /home/yvand/www/] strip per-dir prefix: /home/yvand/www/icon.png -> 
> icon.png
> 127.0.0.1 - - [09/Jul/2013:16:04:36 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (3) [perdir 
> /home/yvand/www/] applying pattern '^(.+)' to uri 'icon.png'
> 127.0.0.1 - - [09/Jul/2013:16:04:36 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (4) [perdir 
> /home/yvand/www/] RewriteCond: 
> input='/pictures//home/yvand/www/icon.png' pattern='-f' => not-matched
> 127.0.0.1 - - [09/Jul/2013:16:04:36 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (1) [perdir 
> /home/yvand/www/] pass through /home/yvand/www/icon.png


With :
> RewriteEngine On
> RewriteCond %{DOCUMENT_ROOT}/pictures%{REQUEST_FILENAME} -f
> RewriteRule ^(.+) /pictures/$1 [L]
I got :
> 127.0.0.1 - - [09/Jul/2013:16:08:33 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (3) [perdir 
> /home/yvand/www/] strip per-dir prefix: /home/yvand/www/icon.png -> 
> icon.png
> 127.0.0.1 - - [09/Jul/2013:16:08:33 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (3) [perdir 
> /home/yvand/www/] applying pattern '^(.+)' to uri 'icon.png'
> 127.0.0.1 - - [09/Jul/2013:16:08:33 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (4) [perdir 
> /home/yvand/www/] RewriteCond: 
> input='/home/yvand/www/pictures/home/yvand/www/icon.png' pattern='-f' 
> => not-matched
> 127.0.0.1 - - [09/Jul/2013:16:08:33 +0200] 
> [localhost/sid#e454e0][rid#10afbb0/initial] (1) [perdir 
> /home/yvand/www/] pass through /home/yvand/www/icon.png

As Jens pointed out REQUEST_FILENAME contains the whole path. I thought 
not because of "strip per-dir prefix: /home/yvand/www/icon.png -> 
icon.png". Sorry.


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


Mime
View raw message