Connecting Tech Pros Worldwide Help | Site Map

Apache appending .php extension?

raisins@gmail.com
Guest
 
Posts: n/a
#1: May 24 '06
This is kind of an obscure question, and I hope someone has a clue
what's going on.

I've got PHP4 running on Apache 1.3 on win32, and whenever I request a
URL like so:
http://localhost/tag/
It appears that the server is actually calling the script
http://localhost/tag.php (which is a real file). However, when I do
something like
http://localhost/nonexistantfile/
Apache does not try to serve up anything at all. The behavior of
treating /tag/ like /tag.php is really screwing up my attempts to do
RewriteRule matching. Please help!

Erwin Moller
Guest
 
Posts: n/a
#2: May 24 '06

re: Apache appending .php extension?


raisins@gmail.com wrote:
[color=blue]
> This is kind of an obscure question, and I hope someone has a clue
> what's going on.
>
> I've got PHP4 running on Apache 1.3 on win32, and whenever I request a
> URL like so:
> http://localhost/tag/
> It appears that the server is actually calling the script
> http://localhost/tag.php (which is a real file). However, when I do
> something like
> http://localhost/nonexistantfile/
> Apache does not try to serve up anything at all. The behavior of
> treating /tag/ like /tag.php is really screwing up my attempts to do
> RewriteRule matching. Please help![/color]

Hi,

My guess is that your RewriteRule's are causing this problem.
Under 'normal' apache installation, this doesn't happen.

Try to remove your extra rules, make a plain entry in conf for your site,
reload Apache gracefull, and retry.
Does it still happen?

Regards,
Erwin Moller
raisins@gmail.com
Guest
 
Posts: n/a
#3: May 24 '06

re: Apache appending .php extension?


Thanks for the response. I have tried commenting out all my Rewrite
directives (I have checked .htaccess and httpd.conf), and this is still
happening. It seems crazy. Is there some other file I can check maybe?

raisins@gmail.com
Guest
 
Posts: n/a
#4: May 25 '06

re: Apache appending .php extension?


I have checked that too -- there is no /tag/ directory (or redirect or
anything) -- and the problem occurs for any file, e.g. if I access
http://localhost/privacy/ it pulls up http://localhost/privacy.php, and
there is definitely no /privacy/ directory!!

Adam Harvey
Guest
 
Posts: n/a
#5: May 25 '06

re: Apache appending .php extension?


On Wed, 24 May 2006 20:54:09 -0700, raisins wrote:[color=blue]
> I have checked that too -- there is no /tag/ directory (or redirect or
> anything) -- and the problem occurs for any file, e.g. if I access
> http://localhost/privacy/ it pulls up http://localhost/privacy.php, and
> there is definitely no /privacy/ directory!![/color]

Do you have MultiViews and/or mod_negotiation switched on in Apache? My
recollection is that it can have similar effects to this.

Adam

--
Adam Harvey

To e-mail: don't make an example out of me!

raisins@gmail.com
Guest
 
Posts: n/a
#6: May 25 '06

re: Apache appending .php extension?


Adam Harvey wrote:[color=blue]
>
> Do you have MultiViews and/or mod_negotiation switched on in Apache? My
> recollection is that it can have similar effects to this.
>
> Adam
>[/color]


I don't want to overstate this, but you are a genius. Multiviews was
turned on for the base directory, and disabling it has solved my
problems. I definitely would not have found this on my own. Thank you!

Closed Thread