[thelist] ?type=icecream to /icecream

Matt Warden mwarden at gmail.com
Tue Apr 8 14:47:01 CDT 2008


On 4/8/08, John Allsopp <john at johnallsopp.co.uk> wrote:
> A basic question for all you out there, but one I've never used (because
>  I believe the search engines now read ?s quite happily, but perhaps I'm
>  wrong about that), but now I have a client that's insisting on it (I
>  think the milkman told him it's a good idea).
>
>  So
>
>  What's the PHP or server tool/plugin/function thing I have to use to get
>  my URLs to be, for instance, /food/icecream when what's really going on
>  is ?type=food&name=icecream
>
>  And what, in outline, do I need to do. Does it just seamlessly work, or
>  do I need to change my code or what?

Are you using PHP on Apache? If so, assuming there is no /food
directory, it will execute index.php and the full path will be
available in environment variables which you could then tokenize.

Alternatively, you could use mod_rewrite:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

-- 
Matt Warden
Cincinnati, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list