Website Structure for Small Site without DB
<p>I'm trying to setup a system to minimize complexity for people updating the site as I will not be the main person updating daily content AND also provide clean URLs.</p>

<p>Since I am unable to use a DB, all of the content resides in one of two base folders (/private/content OR /private/utilities).  For normal daily updates, the utilities (contains the page wrapper - header, nav, footer, etc.) folder wouldn't need to be accessed.  This minimizes the amount of visible code to the daily editor.</p>

<p>I've created an array ($allowedContent) that has the list of valid sections that are accessible.  The code tests against that array to verify that the user is not attempting to access inappropriate content.  With the code below, these requests would be successful.  Everything else would fail.</p>

<ul>
<li>www.example.com/</li>
<li>www.example.com/popup/*</li>
<li>www.example.com/test</li>
<li>www.example.com/hello</li>
<li>www.example.com/foobar</li>
</ul>

<p>My question is:
Is there anything that sticks out as a problem with this approach?</p>

<p><strong>.htaccess</strong></p>

<pre><code>RewriteEngine On
#  Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</code></pre>

<p><strong>PHP</strong></p>

<pre><code>// parse the URL
$requestURI = explode('/', $_SERVER['REQUEST_URI']);
//print_r ($requestURI);

// a list of non-restricted dynamic content
$allowedContent = array("test", "hello", "foobar");
$allowAccess = false; // assume hackers :o

// determine the section
if (!$requestURI[1]) { // none defined - use root/home
    $section = 'home';
    $skin = true;
    $allowAccess = true;
} elseif ($requestURI[1] == 'popup') { // popup - no skin
    $section = $requestURI[2];
    $skin = false;
    $allowAccess = true;
} else {
    if (in_array($requestURI[1], $allowedContent)) { // verify that the requested content is allowed / prevent someone from trying to hack the site
        $section = $requestURI[1];
        $skin = true;
        $allowAccess = true;
    } else { // this would be either a 404 or a user trying to access a restricted directory
        echo "evil laugh"; // obviously, this would change to a 404 redirect
    }
}
</code></pre>

<p>Added code where content is called</p>

<pre><code>// call the relevant content pieces
if ($allowAccess == true) {
    if ($skin == true ) {
        // call wrapper part 1
        include $_SERVER['DOCUMENT_ROOT'] . '/private/utilities/wrapperOpen.php';

        // call aside
        include $_SERVER['DOCUMENT_ROOT'] . '/private/utilities/header.php';

        // call aside
        include $_SERVER['DOCUMENT_ROOT'] . '/private/utilities/aside.php';
    }

    // call CONTENT (based on section)
    include $_SERVER['DOCUMENT_ROOT'] . '/private/content/' . $section . '/index.php';

    if ($skin == true ) {
        // call branding
        include $_SERVER['DOCUMENT_ROOT'] . '/private/utilities/branding.php';

        // call footer
        include $_SERVER['DOCUMENT_ROOT'] . '/private/utilities/footer.php';

        // call wrapper part 2
        include $_SERVER['DOCUMENT_ROOT'] . '/private/utilities/wrapperClose.php';
    }
}
</code></pre>
