Emulate single application entry point with .htaccess
Moderator: General Moderators
- allspiritseve
- DevNet Resident
- Posts: 1174
- Joined: Thu Mar 06, 2008 8:23 am
- Location: Ann Arbor, MI (USA)
Re: Emulate single application entry point with .htaccess
Right... I guess I can't see that working if the links are so varied that you can't search and replace.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Emulate single application entry point with .htaccess
Haha...welcome to my world?Right... I guess I can't see that working if the links are so varied that you can't search and replace.
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.
- allspiritseve
- DevNet Resident
- Posts: 1174
- Joined: Thu Mar 06, 2008 8:23 am
- Location: Ann Arbor, MI (USA)
Re: Emulate single application entry point with .htaccess
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.
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
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
Subclass Zend dispatcher for your page controller paradigm?