You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chad Day <cd...@atpco.com> on 2002/12/04 16:30:08 UTC

[users@httpd] RE: users Digest 4 Dec 2002 02:26:30 -0000 Issue 620

>What is the "/?" doing on the end of %{REQUEST_URI}?
>
>You need to look in the RewriteLog (with RewriteLogLevel 9) to see what is
>wrong beyond that.
>
>Joshua.

Thanks again for the help.. I'm still getting the loop no matter what
fiddling I seem to do with the rule.

This is from the rewrite_log ..


206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (2) init rewrite
engine with requested uri /cday2
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (3) applying pattern
'^(.+)' to uri '/cday2'
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (4) RewriteCond:
input='/cday2' pattern='!-f' => matched
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (2) rewrite /cday2 ->
/view.php?ID=/cday2
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (3) split
uri=/view.php?ID=/cday2 -> uri=/view.php, args=ID=/cday2
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (2) explicitly
forcing redirect with http://calendar.domain.com/view.php
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (1) redirect to
http://calendar.domain.com/view.php?ID=/cday2 [REDIRECT/302]
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (2) init rewrite
engine with requested uri /view.php
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (3) applying pattern
'^(.+)' to uri '/view.php'
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (4) RewriteCond:
input='/view.php' pattern='!-f' => matched
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (2) rewrite
/view.php -> /view.php?ID=/view.php
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (3) split
uri=/view.php?ID=/view.php -> uri=/view.php, args=ID=/view.php
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (2) explicitly
forcing redirect with http://calendar.domain.com/view.php
206.181.245.167 - - [04/Dec/2002:11:32:02 +0000]
[calendar.domain.com/sid#80b7a04][rid#813b034/initial] (1) redirect to
http://calendar.domain.com/view.php?ID=/view.php [REDIRECT/302]

It's realizing that the URL isn't found, redirects to view.php with the URL
being rewritten mostly correctly (I need to get rid of that leading slash
somehow, so it's ID=cday2 instead of ID=/cday2, but I can always strip that
in the php script), but then thinks view.php isn't found .. and that's what
I don't understand, why it matches that when the pattern is set to !-f, so I
hit the infinite loop.

My current ruleset:

RewriteLogLevel 9
RewriteLog /usr/local/www/sites/domain.com/logs/rewrite_log
LogFormat COMBINED
ErrorLog /usr/local/www/sites/domain.com/logs/error_log
TransferLog /usr/local/www/sites/domain.com/logs/access_log
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) /view.php?ID=$1 [R,L,NE]

Thanks for any help,
Chad


---------------------------------------------------------------------
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] RE: users Digest 4 Dec 2002 02:26:30 -0000 Issue 620

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 4 Dec 2002, Chad Day wrote:

> [calendar.domain.com/sid#80b7a04][rid#813b034/initial] (1) redirect to
> http://calendar.domain.com/view.php?ID=/cday2 [REDIRECT/302]

Hmm... This doesn't look like the same rule you have below.

> [calendar.domain.com/sid#80b7a04][rid#813b034/initial] (4) RewriteCond:
> input='/view.php' pattern='!-f' => matched


> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.+) /view.php?ID=$1 [R,L,NE]

Well, does view.php exist in the DocumentRoot?  You can easily exclude
view.php explicitly by using another RewriteCond, but the question is, is
the -f test working at all, or is it always returning false?

Joshua.

---------------------------------------------------------------------
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