title: URL Rewrite with parameter and php query
body: <p>Directories:
   <strong>eventfinder</strong> is project folder</p>
  
  <ul>
  <li>Localhost<br>
  -- project1<br>
  -- project2<br>
  -- <strong>eventfinder</strong><br>
  --- .htaccess</li>
  </ul>
  
  <p>User comes to the page <a href="http://localhost/eventfinder/" rel="nofollow noreferrer">http://localhost/eventfinder/</a> and types 'randomevent123' after /eventfinder/</p>
  
  <p>then php query happens with ?event=randomevent123 </p>
  
  <pre><code>$event = $_GET['event'];
  
  $stmt = $conn-&gt;prepare("SELECT * FROM events WHERE name = :name");
  $stmt-&gt;bindParam(":name", $event);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>and returns data from database</p>
  
  <p>I am trying to rewrite my url but I don't understand what is the problem...</p>
  
  <pre><code>http://localhost/eventfinder/index.php?event=randomevent123
  </code></pre>
  
  <p>to </p>
  
  <pre><code>http://localhost/eventfinder/randomevent123
  </code></pre>
  
  <p>With .htaccess</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^([^/]*)$ /index.php?event=$1 [L] 
  </code></pre>
  
  <p>But query won't work.</p>