Search code examples
phpapacheurlmamp

MAMP Returning 404 When URL Too Long


I'm working with a GET request that is about 987 characters long and when I'm developing the application locally (PHP), I am seeing a 404 error even though on my web server, the exact application works just fine.

I'm guessing this is a MAMP specific thing because the same application works on the web server.

Interestingly enough, I'm not getting a 414 (Request URI Too Large), I'm receiving a 404.

Any ideas?

Edit: The apache log says:

[Tue May 31 00:35:27 2011] [error] [client ::1] File does not exist: /Users/tim/Desktop/htdocs/index.php/controller/(restofurl)

The rest of the URL contains no offending characters, simply A-Z.

Again, the same request works on a live server, it's just my local environment that's having the issue.

Edit again: If i make a simple PHP script that prints out all GET variables, http://localhost/test.php?asd=asdasd.......1700chars <--- works fine

However

http://localhost/test.php/asd=asdasd.......1700chars <--- fails

This is quite mysterious..


Solution

  • This looks like your MAMP Server has AcceptPathInfo disabled which is necessary to parse URLs in the

    /index.php/something/else
    

    form.

    Enable it in your server configuration.