Geoff Soper wrote:
On a related note how would I 'disguise'
http://domain/index.php?page=contact as http://domain/contact.htm to
allow indexing of each dynamic page in search engines?
<shameless_plug>
You can do it in apache with URL rewriting. Just done a site using this
technique, at
http://cdnopenhouse.com/
All of the php "called" resides in the root folder. Most of the requests
actually go to the same file, despite appearing as folders, subfolders,
whatever.
If you really want to see some of the rewriting code, I can show you, but there's
a lot of it (it's a big site)
</shameless_plug>
Benefits -
Friendly URLs - people do actually find it easier to know where they
are on a site if the URL contains actual words that reflect it
You can hide the platform to some extent, so that you can rewrite the
site in Perl, ASP, JSP, whatever, without having to give any indication
to the user
Once set up, it's easy to redesign the implementation of the site, since
the "virtual" folder names don't have to relate to an actual folder on the
webserver
You can use it to handle old urls (from an existing site) with a php file,
or even directly call your new php page(s) with the right query parameters
(if the old site had a relatively fixed url/folder/page naming scheme)
You can use it to make files appear to be in folders that they are not.
Disadvantages
If it's a big or complex site, the rewrite rules can become quite complex,
and if you're new to this kind of thing, or to regular expressions, it can be
a bit tricky
With a lot of rewrite rules, the server does have to work a bit harder, especially
if the regexps are complex (the site i mentioned has 200+ rewrite rules, but a lot
of these are to handle mapping 2500 old pages to new ones)
If you're having trouble getting the hang of it, it can be an absolute bitch!
There's a good guide to get you started at
http://httpd.apache.org/docs/misc/rewriteguide.html
HTH!
Matt