httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chad Day" <>
Subject [users@httpd] RE: mod_rewrite issues [ongoing, retitled]
Date Wed, 04 Dec 2002 19:44:51 GMT
I see.  I think I found the problem, I have to specity the full document
root path in the RewriteCond, even though the DocumentRoot is correct.  So
now I have:

DocumentRoot /usr/local/www/vhosts/
DirectoryIndex index.php
RewriteLogLevel 9
RewriteLog /usr/local/www/sites/
ErrorLog /usr/local/www/sites/
TransferLog /usr/local/www/sites/
RewriteEngine on
/usr/local/www/sites/{REQUEST_FILENAME} !-f
RewriteRule ^(.+) /view.php?ID=$1 [R,L,NE]

This -almost- works.  It redirects correctly, but with the leading slash
problem: goes to:

but like I mentioned, I can strip that off in PHP.  The only other issue I
have is requests to: or

go to :

In the rewritelog file: - - [04/Dec/2002:15:48:01 +0000]
[][rid#813b034/initial] (2) init rewrite
engine with requested uri / - - [04/Dec/2002:15:48:01 +0000]
[][rid#813b034/initial] (3) applying pattern
'^(.+)' to uri '/' - - [04/Dec/2002:15:48:01 +0000]
[][rid#813b034/initial] (4) RewriteCond:
pattern='!-f' => matched

It doesn't seem to be picking up the directory index (even after I added the
DirectoryIndex line in the vhost, which I don't think was necessary as it
was defined earlier and works fine everywhere else).  I noticed that 2nd /
in the last line of the log, and changed the RewriteCond to:

/usr/local/www/sites/{REQUEST_FILENAME} !-f

but the same problem for the DocumentIndex still exists.  Do I need to write
another rule specifically to handle DocumentIndex requests, or did I do
something else wrong?


>> view.php certainly exists.  no matter what file I go to in that domain,
>> starts looping, even if I just go to, which
>> load up index.php by default.  It matches, goes to view.php, then the
>> request on view.php also matches, begin loop.

>I know.  What I'm suggesting is to put in a specific RewriteCond that
>excludes view.php (testing on REQUEST_FILENAME or REQUEST_URI).  The you
>will be able to test with other files to see whether -f is failing

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message