site structure/URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ptysell
Forum Commoner
Posts: 34
Joined: Tue Dec 02, 2003 9:27 pm
Location: USC

site structure/URL

Post by ptysell »

I am in the preliminary stages of development of revamping a web site that was done in PERL and converting it to PHP/MYSQL.

I want old bookmarks to work.

Here is my dilemma

Would it be better to develop the site around the concept of a URL request looking like
http://www.something.com/index.php?sect ... xx&....ect

It seams as if this avenue is the easiest to do because there is one file that is being requested and it generates code based on the variables passed to it through the link.

This is a method that I have implemented in the past without any problems.

OR

This is what I would like the URL request to look like
http://www.something.com/lala/subsection/

Now this method would allow for the old bookmarks to still be valid, but then there would need to be a directory structure and each folder would need a PHP file in it with includes and what not.

I would prefer this method.

So my question to you is which would be better in the long run?

Also in regards to method 2, how would one go about getting the requested variables out of the URL request so that I can manipulate the PHP content base on them?

I hope that this made some since...now it is time for sleep...

Thanks
niceguyeddie
Forum Newbie
Posts: 13
Joined: Fri Nov 28, 2003 7:12 am
Location: Westminster, MD

Re: site structure/URL

Post by niceguyeddie »

ptysell wrote:
So my question to you is which would be better in the long run?

Also in regards to method 2, how would one go about getting the requested variables out of the URL request so that I can manipulate the PHP content base on them?
The directory structure is much more perferable for SEO reasons than anything else. It also looks a little nicer.

Here's how we are doing it in Xaraya without modrewrite. It might give you a couple of ideas.

http://docs.xaraya.com/docs/rfcs/rfc0023.html
ptysell
Forum Commoner
Posts: 34
Joined: Tue Dec 02, 2003 9:27 pm
Location: USC

Post by ptysell »

this is what i came up with

Code: Select all

$urlpath = $_SERVER['PHP_SELF'];
$dirpath = explode('/',$urlpath);
is this the best way?
Post Reply