title: How to fix .htaccess mod_rewrite server error on localhost
body: <p><strong>Context</strong></p>
  <p>I have a website where users can create articles. I'm trying to use mod_rewrite to make my links include the title of the article for SEO purposes. To start, though, I'm just trying to get the ID of the article and users in the rewritten URL because that's how I access the article. I'm new to regular expressions and editing file configuration in general, so I've been trying to understand what's going on with these mod_rewrite lines. I'm still left failing to understand why the code doesn't work.</p>
  <p><strong>Problem</strong></p>
  <p>I have a URL on my localhost, <code>localhost/Real%20Website/readArticles.php?article_id=86&amp;userid=64</code>.</p>
  <p>I want to change this to <code>localhost/Real%Website/readArticles/86/64</code>.</p>
  <p>To do so, I added the following code to my .htaccess file:</p>
  <pre><code>RewriteEngine on
  
  RewriteCond %{REQUEST_FILENAME} !-d
  
  RewriteCond %{REQUEST_FILENAME}\.php -f
  
  RewriteRule ^readArticles/([0-9+])/([0-9]+) readArticles.php?article_id=$1&amp;userid=$2 [NC, L]
  </code></pre>
  <p>With this code, I get the following error:</p>
  <pre><code>Server error!
  The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
  
  If you think this is a server error, please contact the webmaster.
  
  Error 500
  localhost
  Apache/2.4.46 (Unix) OpenSSL/1.1.1h PHP/7.4.12 mod_perl/2.0.11 Perl/v5.32.0
  </code></pre>
  <p>I'm unsure what the problem is here. Is it because I have to account for the <code>Real Website</code> folder?</p>
  <p><strong>Question</strong></p>
  <p>How do I fix this server error with the code given above?</p>
  <p>Let me know if there are any questions.</p>