Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache2 forces me 2 specify 'php' file extensions |
|
Author |
|
elwoody
Joined: 05 Oct 2006 Posts: 5 Location: SFCA
|
Posted: Thu 05 Oct '06 6:35 Post subject: Apache2 forces me 2 specify 'php' file extensions |
|
|
Friends,
I gotz:
Apache 2.0.59
Php 5.1.6
WXPP-SP2
Thanks in advance for your help - this is killing me, yet I'm certian it's simple.
I just upgraded from Apache 1.3, and now I must add '.php' to all my urls - otherwise I get 404's.
This works:
http://localhost/phpinfo.php
This doesn't - though it did with 1.3:
http://localhost/phpinfo
How do I register a file alias? Or, if that's not what it is, how might I fix this? |
|
Back to top |
|
markymark
Joined: 26 Aug 2006 Posts: 10 Location: Brighton, UK
|
Posted: Thu 05 Oct '06 9:34 Post subject: |
|
|
I'm no expert on this but it looks like you're going to need to do content negotiation using mod_negotiation.
There's a good bit of information at
http://www.websiteoptimization.com/speed/tweak/rewrite/
Hope that helps.
Mark |
|
Back to top |
|
markymark
Joined: 26 Aug 2006 Posts: 10 Location: Brighton, UK
|
Posted: Thu 05 Oct '06 9:41 Post subject: |
|
|
There seems to be another way to do this. Try adding:
ForceType application/x-httpd-php
to your .htaccess file.
Mark |
|
Back to top |
|
Brian
Joined: 21 Oct 2005 Posts: 209 Location: Puyallup, WA USA
|
Posted: Fri 06 Oct '06 2:07 Post subject: |
|
|
phpinfo.php is a file that you are requesting. The server is simply assuming that just phpinfo is a directory. When you add the extension it knows that it needs to handle the file in a certain way. If you don't add the extension then it must be FORCED to assume that this is a PHP file, in which case what would happen if you had a file called PHPINFO.PHP and a directory called PHPINFO and you just called http://localhost/phpinfo? Would it go to the directory or open the PHP file?
Sounds confusing to me.
Are you saying that this would go to phpinfo.php on your 1.3 server?
I have never used 1.3 version, but I cannot imagine that would be the case. That means the server is being instructed to add the .php or perhaps phpinfo.php is one of the defined default pages, or mod_rewrite is completing the url, sheeesh, I just don't know.
I'd say that you need to simply include the .php, why not after all is my question |
|
Back to top |
|
CanUuRead
Joined: 18 Sep 2006 Posts: 38
|
|
Back to top |
|
|
|
|
|
|