| Welcome to WebmasterWorld Guest from 188.8.131.52 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|How to read URL Segments?|
| 8:40 pm on Apr 7, 2007 (gmt 0)|
Passing parameters to a PHP script via the URL is normally done by using the question mark:
However, I've seen some sites usa a different URL structure:
How does Apache behave in this case? Does it call the index.php file, and does it then pass the "/foo/stuff" string to it?
Does Apache need any special configuration to do this, or it does this by default? If so, how then can I catch such string "/foo/stuff" in my PHP script?
| 8:46 pm on Apr 7, 2007 (gmt 0)|
See Apache 2.x core AcceptPathInfo [httpd.apache.org] directive.
| 12:58 pm on Apr 8, 2007 (gmt 0)|
Thanks for this useful info.
I've also seen segment URLs (/index.php/foo/stuff) work on systems running Apache 1.3
| 1:24 pm on Apr 8, 2007 (gmt 0)|
Apache 1.3 doesn't support AcceptPath info, so you'd have to use mod_rewrite:
A guide to search-engine-friendly links with mod_rewrite [webmasterworld.com] from our WebmasterWorld library.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved