Frontcontroller help
<pre><code>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
</code></pre>

<p>php</p>

<pre><code>&lt;?php

$pagesDir = "pages";

// Get the request
$page = $_SERVER['REQUEST_URI'];   

// Strip the first slash
$page = substr($page, 1);

// Prevent access to higher level folders
$page = str_replace('..', '', $page);    

// Do some mapping to actual files in a subfolder
$page = "$pagesDir/$page";    

// Serve an error page if not found
if (!file_exists($page)) {
$page = "$pagesDir/error.html";
}

// Prevent anything from being output until it is ready
ob_start();
include($page);
$contents = ob_get_clean();

// Use a template with the variable $contents where you want the page's content to go
ob_start();
include($template);
$output = ob_get_clean();
echo $output;

?&gt;
</code></pre>

<p><i>Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\index.php on line 29</i></p>
