There is a great article on this site that walks through how to do this: http://www.phpbuilder.com/columns/tim19990117.php3 and http://www.phpbuilder.com/columns/tim19990117.php3
But the basic idea is that you tell your Web Server that it needs to send any requests for a given URL to a specific php script. This is done with the AliasMatch command using Apache. Here is an example from my own site that works just fine.
AliasMatch /images/(.*) "/web/mysite/images/$1"
AliasMatch /javascript/(.*) "/web/mysite/includes/$1"
AliasMatch /templates/(.*) "/web/mysite/templates/$1"
AliasMatch /article/(.*) "/web/mysite/public-html/main.html/$1"
AliasMatch /recipe/(.*) "/web/mysite/public-html/main.html/$1"
Here I have 5 directories that I'm telling Apache how to deal with. Whenever someone comes to mysite and requests a URL that ends in /images/ with anything following it, Apache will look in the directory /web/mysite/images/ for the value following the above requested image. Now that is the basics and just shows how someone can request from me an image and it will be pulled from a directory that is outside of my webroot.
What you want to do is more like my last 2 entries above one goes to articles and the other to revipies. So if a user was requesting a specific article they'd go to a URL on my site like www.mysite.com/article/1 and Apache would send that request to my main.html page. Now my main.html page has some work to do to make the article appear:
$url_array = explode("/", $REQUEST_URI);
$section = $url_array[1];
Now what this code does is break apart the request URI to get the pieces that I'm interested in. This is the type of request made, in this case article. Now that I know the user is requesting an article I can pull out the other parts of the URI that will be needed for my code to display the article.
switch($section) {
case "article":
include "$INCLUDES/mysite/article.php";
$a_id = $url_array[2];
if ($a_id == "submit") {
// Do somthing with submitted data
}
elseif ($a_id == "post") {
// Do something with posted data
else {
$html = getArticle($db,$a_id);
}
}
break;
Now for my code there are 3 different pieces of information that could exist after the /article/ part of the URI. I could either have a simple number of an article as I display above, or I could be posting or submitting data. Since we are talking about displaying an article I've omitted the unneeded code. Now that I know I'm going to be displaying an article and I've gotten the ID of the article to display all I need to do is get the article. I do this by calling a helper function and giving it my database connection and the article ID to retrieve. This will return the article from the database for me, which I capture and display later when the rest of the page has been built.
I hope this helps, but I really recommend reading the articles above they were great helps to me in building my site.