FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » Ultra-Nerdy Web Design Question

   
Author Topic: Ultra-Nerdy Web Design Question
saxon75
Member
Member # 4589

 - posted      Profile for saxon75           Edit/Delete Post 
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 | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
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

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
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
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
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 . . .

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
larisse
Member
Member # 2221

 - posted      Profile for larisse   Email larisse         Edit/Delete Post 
/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.

Posts: 822 | Registered: Jul 2001  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
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.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
larisse
Member
Member # 2221

 - posted      Profile for larisse   Email larisse         Edit/Delete Post 
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.

Posts: 822 | Registered: Jul 2001  |  IP: Logged | Report this post to a Moderator
mackillian
Member
Member # 586

 - posted      Profile for mackillian   Email mackillian         Edit/Delete Post 
TOTALLY nerdy. [Razz]

Fugu's brain is quite amazing.

Posts: 14745 | Registered: Dec 1999  |  IP: Logged | Report this post to a Moderator
saxon75
Member
Member # 4589

 - posted      Profile for saxon75           Edit/Delete Post 
[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]

Posts: 4534 | Registered: Jan 2003  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
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.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
saxon75
Member
Member # 4589

 - posted      Profile for saxon75           Edit/Delete Post 
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.
Posts: 4534 | Registered: Jan 2003  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
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 | Report this post to a Moderator
Kwea
Member
Member # 2199

 - posted      Profile for Kwea   Email Kwea         Edit/Delete Post 
Use tinyurl. (joke)

[ April 14, 2005, 11:49 AM: Message edited by: Kwea ]

Posts: 15082 | Registered: Jul 2001  |  IP: Logged | Report this post to a Moderator
mackillian
Member
Member # 586

 - posted      Profile for mackillian   Email mackillian         Edit/Delete Post 
Nerds.
Posts: 14745 | Registered: Dec 1999  |  IP: Logged | Report this post to a Moderator
saxon75
Member
Member # 4589

 - posted      Profile for saxon75           Edit/Delete Post 
You're just jealous.
Posts: 4534 | Registered: Jan 2003  |  IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

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