title: htaccess - read string at end of URL, append to script, redirect
body: <p>My URL is <a href="https://example.com/555" rel="nofollow">https://example.com/555</a></p>
  
  <p>I want to use htaccess to redirect this to <a href="https://example.com/view.php?id=555" rel="nofollow">https://example.com/view.php?id=555</a></p>
  
  <p>I know I need to use the RewriteRule as follows</p>
  
  <pre><code>RewriteRule ^(.*)$ https://www.example.com/view.php?id= [R=301,L]
  </code></pre>
  
  <p>How do I read and append the number in the URL to the script with htaccess?</p>