httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Pasher <>
Subject Re: [users@httpd] Checking if file or directory exist
Date Thu, 11 Sep 2008 17:02:44 GMT
Jason Pruim wrote:
>>>>> RewriteRule . /p.php [L]
>>>> RewriteCond %{REQUEST_FILENAME} !-f
>>>> You're not capturing or passing anything, and how do you get to 
>>>> mail.php?
>>> after you load there will be 
>>> a link to
>>> The basic premise I have been working off of is just simply if the 
>>> file exists, let that file handle serving the page, if it DOESN"T 
>>> exist pass it to p.php to handle it.
>>> So with that understanding I don't think that I need to capture 
>>> anything in the rewritecond's other then if the file exists correct?
>> RewriteCond %{REQUEST_FILENAME} !-d
>> You shouldn't have to worry about capturing any query string since 
>> you are performing an internal rewrite (the URL stays the same for 
>> the user). Referring back to your other email (which I mistakenly 
>> nuked already)...
>> --------------------
>> That is odd.... I moved the rewrite rules to a .htaccess file and now 
>> the real links work right, but the false links don't go into my 
>> handeler script... in other words 
>> works but 
>> does NOT...
>> Here is my .htaccess file... Does it look right?
>> Options +FollowSymlinks
>> RewriteEngine on
>> RewriteLog /var/log/purl.virt.rewrite.log
>> RewriteLogLevel 9
>> RewriteCond %{REQUEST_FILENAME} !-f
>> RewriteCond %{REQUEST_FILENAME} !-d
>> RewriteRule . /p.php [L]
>> --------------------
>> So there is no file/directory called jasonpruim112 
>> <>, correct? I copied 
>> your .htaccess file (removing the RewriteLog* references) and it 
>> correctly rewrites the URL request for /jasonpruim112 
>> <> to p.php. Is this not 
>> what you are seeing?
> Hey Justin,
> You are correct that jasonpruim112 does not exist but is linked in a 
> database... Although, I did some searching on the net and fighting 
> with my config files and noticed that AllowOverides was set to none 
> rather then all....
> Once I made that switch both the main link, and the internal links all 
> started working properly.
> Sometimes I hate how picky computers can be hehehe.

Doh. I forgot to mention that moving to the .htaccess file would require 
apache to allow overrides in that directory. That was my default setting 
in my testing environment, so I didn't even think of it. If all else 
fails, I find checking the apache error log can sometimes reveal things 
that you may not have known were going wrong.

At any rate, it sounds like you're all set now!

Justin Pasher

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