Page 2 of 2

Re: Emulate single application entry point with .htaccess

Posted: Thu Feb 26, 2009 10:56 pm
by allspiritseve
Right... I guess I can't see that working if the links are so varied that you can't search and replace.

Re: Emulate single application entry point with .htaccess

Posted: Fri Feb 27, 2009 12:02 am
by alex.barylski
Right... I guess I can't see that working if the links are so varied that you can't search and replace.
Haha...welcome to my world? :P

The only solution would be to find links...parse them into name=value pairs and handle it that way so at least the order of the NVP's wouldn't matter. It's a serious PITA and easily avoidable with proper design -- unfortunately this site missed a few steps during design phase -- which is typical for first version prototypes I suppose.

Re: Emulate single application entry point with .htaccess

Posted: Fri Feb 27, 2009 12:26 am
by allspiritseve
Believe me, I hear you... At least I'm lucky (depends on your perspective) enough to work for a small company with a small codebase that doesn't take too long to fix all those mistakes. The hard thing is they have been using the latest project as the "codebase" for the last 6 years and so have left behind a trail of incrementally-updated versions of our codebase. Which means come time to do updates, I've got to make the same fixes over and over again. Blah

I've been thinking about your situation a bit more... if you did parse for key/value pairs like you mentioned, could you do some logic to spit out clean urls based on what keys are set? maybe you could write a script that could search and replace, for example, all links from help.php with id and name set to /help/name/id/, and so on? You've accounted for order, so now it's really just figuring out the types of urls needed. That is, unless whoever wrote your code writes like my boss and throws a couple extra fields in the url just for the hell of it. :)

Re: Emulate single application entry point with .htaccess

Posted: Fri Feb 27, 2009 12:43 am
by Benjamin
Hmm, well the same function that converts the links at runtime could be used as a find/replace tool. You could write a tiny script to open each file, convert the links, then save it.

Re: Emulate single application entry point with .htaccess

Posted: Sat Feb 28, 2009 10:15 pm
by josh
Subclass Zend dispatcher for your page controller paradigm?