posted
So I've decided to do another rewrite of the software that powers sakeriver. Currently, an individual PHP script runs each content section. (e.g. movielist.php handles the movie reviews, index.php handles the front page, etc.) For a number of reasons, I'd like to change the system architecture to have a single entry point script that then calls different functions to handle the different content pages. Aside from, I think, being a better implementation along MVC lines, it should also make things like security and extensibility easier.
The problem with this approach is that it tends to lead to ugly URLs. Right now, for example, if you wanted to read Slash's "Tales from an Office Building" from 9/7/04, you'd go to http://www.sakeriver.com/office.php?select=20040907092600. Now, that's not the prettiest URL, but it's still better than something like http://www.sakeriver.com/index.php?command=editorials§ion=office&select=20040907092600.
I know that an Apache module like mod_rewrite would help me make nice friendly URLs, but my host doesn't have it and doesn't respond well to customer requests like that. And for now, at least, I'm stuck with them.
Alternately, there are .htaccess tricks for making friendly URLs, but the best ones involve renaming your script files to remove the extension, which means that you still have multiple entry points. And I'm trying to avoid that.
Any ideas? Am I just stuck with either having ugly URLs or multiple entry points?
Posts: 4534 | Registered: Jan 2003
| IP: Logged |
With no directory office in the root directory, apache should call the index page with the PATH, I think . . .
Posts: 15770 | Registered: Dec 2001
| IP: Logged |
I make connections. Rapidly. And it can be a bit disconcerting, yes, but it also means I can leverage a small amount of information into a large amount of information, quickly.
I wasn't thinking consciously about saxon's problem after the first two answers, but a possible refinement popped up as I was thinking about something else, which is in my third post.
Posts: 15770 | Registered: Dec 2001
| IP: Logged |
posted
Hahahaha... I believe you about the complexity. It wasn't the quickness that I thought was a bit scary. (I think rather quickly myself, which can result in talking fast and jumping from subject to subject and back again.) It was the subject matter. Computer programming speak makes my brain feel all fuzzy, even when it's just being glossed over.
Kinda wish I could help out more on the subject at hand though.
Posts: 822 | Registered: Jul 2001
| IP: Logged |
posted
Every time I post one of these questions to this board I think to myself, "I should really be posting this on some web programming forum." I've just never been able to find a web programming forum that has people who are as knowledgeable as fugu. You should really be charging for this stuff, dude.
Actually, I'm getting $25 an hour to do it over the (very) short term to bail out IU by implementing a gradebook for next year's online course software.
Posts: 15770 | Registered: Dec 2001
| IP: Logged |
With no directory office in the root directory, apache should call the index page with the PATH, I think . . .
I'm not sure I understand what you mean here. Are you saying that there is a controller script called "office" that could be made into the index page via a .htaccess command? Or that, supposing I have a controller script set up as the index page, if I try going to a non-existant directory, Apache should load the index page instead? I'm pretty sure the latter doesn't work.
Posts: 4534 | Registered: Jan 2003
| IP: Logged |
posted
Yeah, I think the idea doesn't work, at least in the default configuration . . . it might be possible to force, though.
At the very least you can make your index page named whatever you want, including something with no extension, and then just turn on PHP processing for it in an htaccess file, then use a path-like URL (such as http://www.sakeriver.com/index/office/editorials/20040907092600 , where index is the index page, and uses the PATH variables that get passed to determine what to do).
Posts: 15770 | Registered: Dec 2001
| IP: Logged |