View Full Version : web site structure and organization

04-07-2008, 04:00 AM
in the back of my mind i find an extremely obsessive compulsive perfectionist that is curious to what the "best" way to organize a web site is. here's a list of methods i've seen before:

1. php paging (?page=asecondpage).
2. folder paging (domain.ext/anotherpage/).
3. file paging (asecondpage.ext).

i am also curious about ways people organize their images and global css/js/php. i've only been doing this web stuff for about 3 years without any instruction whatsoever. please share with me your methods so that i may prevent any future problems with organization, and so that any other people in this situation can refer to this thread. thanks in advance.

04-07-2008, 04:18 AM
Well you are asking a very curious question. The methods vary and no particular method is exactly better or worse. I've been doing this for about 8 years with no instruction whatsoever, so I'm with ya.

I think in a most situations its good to be able to use the third method (contactus.html) because if you use thoughtful file names you will know the files, and so will the people who search for your site. Sometimes when I search and the keywords are in the file name, I notice this and think that page is probably a good one to look at. (It probably helps with your SEO as well)

I've done PHP Paging like you describe before, and unless your pages are developed as an application that require such methods, I would avoid it. I've come to believe that the simpler the web address is for the visitor, the better. I hate it when the URL is 300 characters long, but that might just be me and not the typical user.

Folder pages are great if you need to break up your content so drastically. If you have sections, (blog, portfolio, etc) it makes sense, but it really doesn't seem all that different from file paging, except the file extension is dropped. This can make it easier if the user might be typing that url.

Every website is going to have a different method. I think for SEO purposes the file pages are the best because of the potential added bonus of ranking, and PHP paging could be more vulnerable to hacking (since you are passing values so blatantly). Do what works, but also what is ultimately best for the user.

04-08-2008, 03:50 AM
Jeremy is right, this is a hard one to answer.

It seems like the trend goes in phases.
Method 3 was the only way at first, then method 2
seemed popular, and sites like this forum do a lot
of method 1.

But I see more and more use of .htaccess to perform
"rewrite rules". This is interesting because the appearance
is method 3, but in actuality, it becomes method 1 internally.

I think SEO and "user logic" sees method 3 as easier to navigate,
but PHP use seems to swing to method 1. So, if you do some
studying on .htaccess, you'll see how the two are now working together.

I can give you an actual example that I saw ... where I was helping
someone with a script. In the example (link below), mouse-over the
various categories and articles and see the URL in the status bar.

The URL is not what is really happening ...
The RewriteRules are providing the PHP with the codes it needs:
RewriteRule ^category(.*).html$ index.php?page=category&category_id=$1 [L]
RewriteRule ^article(.*).html$ index.php?page=article&article_id=$1 [L]

Here's the site in my example:

The appearance is "static pages", but that's not what it is.
I think this makes the URL cleaner, yet performs the PHP coding needed.


Your second part, about storing files ...
That's a personal preference.
I usually have a directory for:
... etc.