[thelist] PHP, mod_rewrite help (Dreamhost)

sbeam sbeam at syxyz.net
Fri Apr 30 10:51:29 CDT 2004

On Friday 30 April 2004 11:13 am, Timothy J. Luoma wrote:
> Long story short: I can get it to work if I use this:
>         /ethan/daily?20040301
> but if I use this
>         /ethan/daily/20040301
> I get a generic "No input file specified" which I believe is
> Dreamhost's   way of issuing a 404 for PHP files under CGI (see [1]
> below).

Hey - I've come up against something similar when you have DefaultType 
specified and using php as a CGI - if there is a matching file called 
daily.php, Apache stops looking there and does not apply any 
mod_rewrite rules. However the PHP binary gets this URL via mod_cgi and 
can't find the file itself - hence your error. This seems contrary to 
the docs, from what I could tell - spent a while trying to figure it 
out, ended up just renaming the php file and matching on my original 
preferred string:

RewriteRule    /daily/([0-9]+)$    daily_processor.php?date=$1

So if you rename your php file to something that does not match the URL, 
then mod_rewrite will match, add the '?' and mod_cgi and PHP will never 
know what happened.



# S Beam - Web App Dev Services
# http://www.onsetcorps.net/

More information about the thelist mailing list