This is topic Ultra-Nerdy Web Design Question in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=033736

Posted by saxon75 (Member # 4589) on :
 
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?
 
Posted by fugu13 (Member # 2859) on :
 
Pass information in via the PATH rather then GET and POST variables.

So your URL http://www.sakeriver.com/index.php?command=editorials§ion=office&select=20040907092600 might become http://www.sakeriver.com/index.php/office/editorials/20040907092600
 
Posted by fugu13 (Member # 2859) on :
 
Oh, and you could just turn on php processing for no extension with a .htaccess file and make that URL into http://www.sakeriver.com/index/office/editorials/20040907092600
 
Posted by fugu13 (Member # 2859) on :
 
Actually, you might be able to just name your controller script the index page, and then link like so:
http://www.sakeriver.com/office/editorials/20040907092600

With no directory office in the root directory, apache should call the index page with the PATH, I think . . .
 
Posted by larisse (Member # 2221) on :
 
/looks up at fugu's posts

Is that what it's like to be in your head? Cause if it is, that's one scary place. Informative and cool, but scary.

Good luck, saxon.
 
Posted by fugu13 (Member # 2859) on :
 
No, my head is much more complex [Wink]

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.
 
Posted by larisse (Member # 2221) on :
 
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. [Big Grin]

Kinda wish I could help out more on the subject at hand though.
 
Posted by mackillian (Member # 586) on :
 
TOTALLY nerdy. [Razz]

Fugu's brain is quite amazing.
 
Posted by saxon75 (Member # 4589) on :
 
[ROFL]
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.

Thanks. [Smile]
 
Posted by fugu13 (Member # 2859) on :
 
Don't give me ideas.

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.
 
Posted by saxon75 (Member # 4589) on :
 
quote:
Actually, you might be able to just name your controller script the index page, and then link like so:
http://www.sakeriver.com/office/editorials/20040907092600

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.
 
Posted by fugu13 (Member # 2859) on :
 
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).
 
Posted by Kwea (Member # 2199) on :
 
Use tinyurl. (joke)

[ April 14, 2005, 11:49 AM: Message edited by: Kwea ]
 
Posted by mackillian (Member # 586) on :
 
Nerds.
 
Posted by saxon75 (Member # 4589) on :
 
You're just jealous.
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2