title: Redirect subdirectory to root URLs using .htaccess
body: <p>Slight tweak on some other questions/answers I found here, which didn't work for me.</p>
  <p>My website had a subdirectory of <a href="http://www.mywebsite.eu/subdirectory" rel="nofollow noreferrer">www.mywebsite.eu/subdirectory</a> where <em>all</em> the website's pages were located. I have now moved all the files to <a href="http://www.mywesbite.eu" rel="nofollow noreferrer">www.mywesbite.eu</a>. The /subdirectory has essentially been deleted.</p>
  <p>How can I do a .htaccess redirect that makes any /subdirectory URL redirect to a URL without the subdirectory.</p>
  <p>Here's an example:
  <a href="http://www.mywebsite.eu/subdirectory/webpage.html" rel="nofollow noreferrer">www.mywebsite.eu/subdirectory/webpage.html</a>
  now needs to be
  <a href="http://www.mywebsite.eu/webpage.html" rel="nofollow noreferrer">www.mywebsite.eu/webpage.html</a></p>
  <p>Instead of doing a redirect on all the pages on my website, I'm hoping there's an easier way to just say &quot;if someone requests a URL with /subdirectory in it, take them to exactly the same URL, just without /subdirectory at the start&quot;</p>
  <p>I originally tried</p>
  <pre><code>RewriteRule ^subdirectory/(.*)$ www.mywebsite.eu/$1 [L,R=301]
  </code></pre>
  <p>but that didn't work. I have this at the very start:</p>
  <pre><code>Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /
  </code></pre>