title: Redirection not working with .htaccess file
body: <p>I am using htaccess to hide GET variables from the URL. I am having a problem. Myy project structure is something like this:</p>
  <pre><code>--project
  
    index.php
  
    /views
  
      login.php
  
      example.php
  
      /user
  
        dashboard.php
  </code></pre>
  <p>So, when I use something like &quot;localhost/project/login&quot;, I am correctly redirected to the login.php page. But when I do something like &quot;localhost/project/user/dashboard&quot;, I get an Apache generated 404 Not Found response.</p>
  <p><img src="https://i.stack.imgur.com/W9yld.png" alt="Error message" /></p>
  <p>This is what I am using in PHP to include the pages with the GET variables:</p>
  <p>PHP code:</p>
  <pre><code>&lt;?php
  if(isset($_GET['page'])) {
  $page = $_GET['page'].'.php';
  if(is_file('views/'.$page)) {
      include 'views/'.$page;
  } else {
      echo 'Page does not exist';
  }
  ?&gt;
  </code></pre>
  <p>htaccess file:</p>
  <pre><code>RewriteEngine on
  RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?page=$1 [NC]
  </code></pre>
  <p>Can anybody give me some guidance? I don't have experience with .htaccess files</p>