Sorry if I am bringing this post up from the dead but it was amazing to find someone else having the same problem (from google search).
I am having this exact problem. All PHP is parsing except for a page that is requested using a mod-rewrite rule. This was all working 100% until an upgrade to Apache 1.3.33 about 2 days ago.
Everything works except for this page. Here is a copy of the .htaccess file.
-----------8<--------------
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/internalfile.php
RewriteRule .* /internalfile.php [last]
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
</IfModule>
-----------8<--------------
What makes this even more bizzare is this problem only happens with Firefox. When I open the URL in IE it works 100% as expected. I am absolutely gobsmacked.
In Firefox, the file opens exactly as mdkelly069 describes
Code:
You have chosen to open
which is a: application/x-httpd-php
from: xxxxxxxxxxx
What should firefox do with this file?
When I open the random file name that firefox has given the file I can read the PHP source in plain text, it has not been parsed.
Has anyone got any futher information on this? I am at a loss as to why this happens? It has been working flawlessly for months, and the Apache/PHP upgrade didn't change any settings only upgraded Apache to 1.3.33 from the previously most recent stable release.
-EDIT UPDATE 1-
Some additional information I have found (which is also the same as mdkelly069 describes)
If I access using sub.domain.com/internalfile.php it works fine. If I access using just sub.domain.com Firefox tries to download the file.
This means that the virtual host is working for both because I am being pointed to the correct directory, but for some reason when I don't specify the .php extension in the URL the parser isn't invoked.
This doesn't happen on other sites (that use index.php). ie.
www.othersite.com works, I don't need
www.othersite.com/index.php
Because of this I attempted to add internalfile.php as a DirectoryIndex file in httpd.conf but this didn't help.
Continuing with my attempts to fix this
-EDIT UPDATE 2-
Just found something odd, if I access sub.domain.com/bla.php (doesn't exist) the page works 100% (because php is in the request URI). Even if I do sub.domain.com/php the page works 100% correct, the parser isn't working if PHP isn't mentioned.
Attempted adding DefaultType to the .htaccess but that didn't help. *more confused*
-EDIT UPDATE 3-
It actually works if you paste anything after the url. sub.domain.com/a works, so it isn't recognising the request if there is no specific file requested.