title: Can't access $_GET after rewrite?
body: <p>Here's the mod_rewrite portion of my .htaccess
      </p>
  
  <pre><code>Options +FollowSymlinks
  
  Options -Indexes
  
  # Prevent Direct Access to files
  &lt;FilesMatch "\.(tpl|ini)"&gt;
   Order deny,allow
   Deny from all
  &lt;/FilesMatch&gt;
  
  # SEO URL Settings
  RewriteEngine On
  RewriteBase /mysite/
  
  # Protects file paths
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /mysite/index.php?route=$1 [NC,QSA,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)/(.*)$ /mysite/index.php?route=$1&amp;page=$2 [NC,QSA,L]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>When I type in <code>http://localhost/mysite/home</code> it correctly takes me to <code>index.php?route=home</code>.</p>
  
  <p>When I type in <code>http://localhost/mysite/services/</code> it works again, and I can correctly access <code>$_GET['route']</code></p>
  
  <p>so for example, my menu has:</p>
  
  <p><code>&lt;li&lt;?php if($_GET['route'] == 'home') { echo ' class="selected"'; ?&gt;&gt;</code></p>
  
  <p>to set the class on that page.</p>
  
  <p><strong>but....</strong></p>
  
  <p>When I type in <code>http://localhost/mysite/services/widget</code>, it correctly takes me to <code>index.php?route=home&amp;page=widget</code> but I get a PHP error if I try to reference <code>$_GET['page']</code> (or ANY <code>$_GET</code> value for that matter) ...which as I mentioned before, I was using to set the <code>selected</code> class of the menu item.</p>
  
  <p>Can someone help me fix this? I must've done something wrong with the second rewriterule... because it doesn't pick up any <code>$_GET</code> values.</p>
  
  <p>...</p>
  
  <p>This is really strange because I use <code>$_GET['route']</code> and <code>$_GET['page']</code> to populate the correct html for the page (similar to an MVC setup)... I would've thought the <code>php include</code> I have on index.php would've failed if it couldn't find the <code>$_GET</code></p>
  
  <p>....</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Maybe it's relevant, but my index.php code looks like this:</p>
  
  <pre><code>if( isset( $_GET[ 'route' ] )) {
      if( file_exists( 'content/' . $_GET[ 'route' ] . '.php' )) {
        if( isset( $_GET[ 'page' ] )) {
          if( file_exists( 'content/' . $_GET[ 'route' ] . '/' . $_GET[ 'page'] . '.php' )) {
            include 'content/' . $_GET[ 'route' ] . '/' . $_GET[ 'page'] . '.php';
          }
        } else {
          include 'content/' . $_GET[ 'route' ] . '.php'; 
        }
      } else {
        header( "Location:404" );
        exit;
      }
    } else {
      header( "Location:home" );
      exit;
    }
  </code></pre>