You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by nik600 <ni...@gmail.com> on 2011/06/06 15:19:40 UTC

[users@httpd] mod_rewrite, same filename matching rules are not processed

Dear all

i'm not sure if this problem is related to a new feature or not of
apache 2.2.16, available in the new debian6 release.

I had an htaccess file like this:
######################################
RewriteEngine on
RewriteRule Test/([^/]+)		Test.php?request=$1	[L]
######################################

If i make a GET request to:

http://server_ip/Test/abc

instead of requesting Test.php?request=abc
it goes to Test.php

It seems that as Test is the same as the file Test.php the rewrite
goes directly to Test.php withoud looking at the rule.

On an older version of apache (debian 5, 2.2.9) i haven't this problem.

Is there a possibility to disable this feature, or to force the rule
to be processed?

Thanks

-- 
/*************/
nik600
http://www.kumbe.it

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite, same filename matching rules are not processed

Posted by nik600 <ni...@gmail.com>.
Ooook... there was a MultiViews directive.

Thanks....and sorry, regards.

>
> multiviews / mod_negotiation?
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



-- 
/*************/
nik600
http://www.kumbe.it

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite, same filename matching rules are not processed

Posted by Eric Covener <co...@gmail.com>.
On Mon, Jun 6, 2011 at 10:46 AM, nik600 <ni...@gmail.com> wrote:
> It seems that the problem is at the very beginning of the request:
>
> request to:
> TestA/ab (ok):
> add path info postfix: /var/www/test/TestA -> /var/www/test/TestA/ab
> ...
> ...
> split uri=Test.php?request=ab -> uri=Test.php, args=request=ab
> ...
> ...
> [perdir /var/www/test/] pass through /var/www/test/Test.php
>
> request to:
> Test/ab (err):
> add path info postfix: /var/www/test/Test.php -> /var/www/test/Test.php/ab
> ...
> ...
> [perdir /var/www/test/] pass through /var/www/test/Test.php
>
> The problem is, my request was on Test/ab, NOT to Test.php/ab !!!
>
> So, probably there must be something that appends automatically the
> .php, but where?

multiviews / mod_negotiation?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite, same filename matching rules are not processed

Posted by nik600 <ni...@gmail.com>.
It seems that the problem is at the very beginning of the request:

request to:
TestA/ab (ok):
add path info postfix: /var/www/test/TestA -> /var/www/test/TestA/ab
...
...
split uri=Test.php?request=ab -> uri=Test.php, args=request=ab
...
...
[perdir /var/www/test/] pass through /var/www/test/Test.php

request to:
Test/ab (err):
add path info postfix: /var/www/test/Test.php -> /var/www/test/Test.php/ab
...
...
[perdir /var/www/test/] pass through /var/www/test/Test.php

The problem is, my request was on Test/ab, NOT to Test.php/ab !!!

So, probably there must be something that appends automatically the
.php, but where?





-- 
/*************/
nik600
http://www.kumbe.it

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite, same filename matching rules are not processed

Posted by nik600 <ni...@gmail.com>.
> Are you sure it's really only 2.2.16 and not w/ additional patches?
> Bug report 50349 is similar.
>
> A RewriteLog would help.
>
It is the standard package of the debian6 squeeze distribution.

This is the RewriteLog level 3

[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fdfac0/subreq] (3) [perdir
/var/www/test/] add path info postfix: /var/www/test/Test.php ->
/var/www/test/Test.php/ab
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fdfac0/subreq] (3) [perdir
/var/www/test/] strip per-dir prefix: /var/www/test/Test.php/ab ->
Test.php/ab
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fdfac0/subreq] (3) [perdir
/var/www/test/] applying pattern 'Test/([^/]+)' to uri 'Test.php/ab'
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fdfac0/subreq] (1) [perdir
/var/www/test/] pass through /var/www/test/Test.php
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fcca40/initial] (3) [perdir
/var/www/test/] add path info postfix: /var/www/test/Test.php ->
/var/www/test/Test.php/ab
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fcca40/initial] (3) [perdir
/var/www/test/] strip per-dir prefix: /var/www/test/Test.php/ab ->
Test.php/ab
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fcca40/initial] (3) [perdir
/var/www/test/] applying pattern 'Test/([^/]+)' to uri 'Test.php/ab'
[06/Jun/2011:16:08:00 +0200]
[/sid#7f33f6c48638][rid#7f33f6fcca40/initial] (1) [perdir
/var/www/test/] pass through /var/www/test/Test.php



-- 
/*************/
nik600
http://www.kumbe.it

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite, same filename matching rules are not processed

Posted by Eric Covener <co...@gmail.com>.
On Mon, Jun 6, 2011 at 9:19 AM, nik600 <ni...@gmail.com> wrote:
> Dear all
>
> i'm not sure if this problem is related to a new feature or not of
> apache 2.2.16, available in the new debian6 release.
>
> I had an htaccess file like this:
> ######################################
> RewriteEngine on
> RewriteRule Test/([^/]+)                Test.php?request=$1     [L]
> ######################################
>
> If i make a GET request to:
>
> http://server_ip/Test/abc
>
> instead of requesting Test.php?request=abc
> it goes to Test.php

Are you sure it's really only 2.2.16 and not w/ additional patches?
Bug report 50349 is similar.

A RewriteLog would help.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org