views:

10

answers:

1

My question is there really an advantage by placing each webpage in it's own directory compared to putting them in a directory?

( www.example.com/ and www.example.com/b.php ) vs ( www.example.com/ and www.example.com/b/ )

A: 

What you've seen is probably not that each file is in its separate folder, but rather a rewriting/routing engine in action. The basic concept is that you tell the server that "a URL that looks like <this>, should point to a file with a filename like <this>, and with <these> parameters". This way, you can create easily readable URLs (which benefit both users, developers and search engines).

Example:

A user types in domain.com/cats/Garfield/. This could be interpreted as domain.com/index.php?category=cats&cat=Garfield by the server. Thus, the "usage URL" is far cleaner and easier to read and remember.

More info in the Wikipedia article about URL Rewriting.

Arve Systad