NYCPHP Meetup

NYPHP.org

[nycphp-talk] Howto create custom URLs

Ben Sgro (ProjectSkyline) ben at projectskyline.com
Mon Mar 26 08:54:45 EDT 2007


Hello again,

This is a pretty good idea ...

Once they click the link that brings them to the page, they only stay for 
one action (to RSVP to an event)
so I don't care what the URL looks like once they are on the page ... its 
getting to the page I want to make
easier ... as in /eventMay VS /eventid=sweet_md5hash ... hopefully this will 
be less prone to error and users
will notice when something is spelled wrong in the URL .. vs's the hash ...

To be honest .. I dont see how users keep messing this up ... all they have 
to do is a click a link to bring them
to the page... but they manage to fudge it at least once a day (error logs 
mailed to myself)

Well, I'll think about it all a bit more before I implement anything .. but 
I like the proxy idea, i can leave my current
db as is for the RSVP page (minus the lookup for eventMay and the new table 
to map eventid to names).

Thanks,

- Ben

----- Original Message ----- 
From: "csnyder" <chsnyder at gmail.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Monday, March 26, 2007 8:46 AM
Subject: Re: [nycphp-talk] Howto create custom URLs


> On 3/19/07, Ben Sgro (ProjectSkyline) <ben at projectskyline.com> wrote:
>
>> Currently I have a software package that creates URLS in this manner:
>> myhost.com/index.php?act=700&eventid=4e732ced3463d06de0ca9a15b6153677
>>
>> Now, I want to make this a bit more user friendly and create URLs like:
>> myhost.com/MayEvent07
>>
>> I'm not sure if I will have the ability to run apache
>> mods (if that's the answer).
>
> The correct approach to this, in my opinion, is to create an
> application proxy -- a script that will parse incoming request for uri
> MayEvent07, convert it into $_GET['eventid'] = 4e...7 using a db
> lookup, and then include() the software package's index.php, using an
> output buffer so that the urls in the software package's response can
> all be converted back to your friendly format.
>
> In other words, build a php wrapper around your software package. Done
> right, it won't know the difference, and you don't have to muck around
> with httpd.conf.
>
> -- 
> Chris Snyder
> http://chxo.com/
> _______________________________________________
> 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 




More information about the talk mailing list