NYCPHP Meetup

NYPHP.org

[nycphp-talk] Howto create custom URLs

Dell Sala dell at sala.ca
Mon Mar 26 12:28:22 EDT 2007


On Mar 26, 2007, at 8:46 AM, csnyder wrote:

> 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.

This is an interesting technique. I like the fact that it could  
easily be wrapped around an existing site without messing around with  
mod_rewrite. But the idea of modifying URLs in the buffered output  
has always seemed a little sketchy to me. I'm imaging some sort of  
regex replace, right? What about urls that are constructed  
dynamically in javascript? And I feel there must be other holes. Is  
there a way this can be done reliably, or am I just being paranoid?

-- Dell





More information about the talk mailing list