Forum Moderators: coopster

Message Too Old, No Replies

path_info in php - how can I use it with index.php?

         

leifwessman

9:05 am on Jun 13, 2003 (gmt 0)

10+ Year Member



This works fine:

[widget.com...]
($path_info becomes "/arg1")

but when I try this:

[widget.com...]

it doesn't work. (error: Page not found)

How can I make the last example work?

I'm using apache. I would like to be able to write anything as an argument, not only "arg1".

Robber

9:37 am on Jun 13, 2003 (gmt 0)

10+ Year Member



perhaps try [widget.com...]

irock

9:41 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do something like this with just a couple of PHP commands and a modified .htaccess...

[widget.com...]

Basically, the .htaccess tells the server that files w/o extension can be treated as a PHP file. Hence, the URL no longer has the file extension part... but it may not be what you wanted.

leifwessman

9:48 am on Jun 13, 2003 (gmt 0)

10+ Year Member




I've already succeded doing

[widget.com...]

but that's not what I want.

I want

[widget.com...]

so that $path_info becomes "/arg1"

Any ideas?

jatar_k

4:18 pm on Jun 13, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



With out mod_rewrite I dont think your method is possible. Apache will treat the no extension as if it was a directory, therefore, 404.