Hi all,

During a recent discussion we talked about a technique for supporting friendly URLs by putting script arguments after the script name, separated by slashes, instead of using a standard query string. http://lists.nyphp.org/pipermail/talk/2006-December/020277.html

example: http://somedomain.com/phpscript/arg1/arg2

I've been using this technique for several months, with great success, but I just ran into a snag. This doesn't seem to work when php is running as a CGI. Here's what appears to be happening (using the example above):

1) apache sees that "phpscript" is an actual php resource, and ignores /arg1/arg2
2) apache passes the full url off the the php CGI
3) the php CGI re-parses the url, and determines the php script it is supposed to execute is "arg2", and of course chokes with the error "No input file specified."

I also found some reports of $_SERVER['PATH_INFO'] not reporting the correct information when running as CGI.

Can anyone suggest a workaround? I hope I don't have to go back to mod_rewrite!

-- Dell


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to