title: Clean URL - How to edit url variables for editing url name & delete folder name on redirect using htaccess?
body: <p>Despite there being thousands of questions similar to this I was unable to make it work for this specific situation.</p>
  
  <h2>delete folder name on redirect</h2>
  
  <pre><code>public_html+
  |
  |    htaccess
  |    robots.txt
  |
  |    libraries+
  |    |   classOne.php
  |    |   classTwo.php
  |
  |    webroot+
  |    |   css
  |    |   images
  |    |   js
  |    |   index.php
  |    |   article.php
  </code></pre>
  
  <p>The following seems to always redirect my main domain to webroot/ as I want but how do I go by deleting the webroot folder name from the url so that it looks like</p>
  
  <p><strong>www.example.com/</strong>
  instead of
  <strong>www.example.com/webroot</strong></p>
  
  <p>I'm using the following code for this..</p>
  
  <pre><code>RewriteBase /webroot/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  </code></pre>
  
  <hr>
  
  <h2>Mask variables &amp; include folder name instead</h2>
  
  <p>I've got an article.php which I'd like to edit the URL to look better for SEO.</p>
  
  <p>In my real domain currently it's showing as below..</p>
  
  <p><strong>www.example.com/webroot/article.php?article_uid=33&amp;article_title=Apple,%20Microsoft%20And%20Free%20Software</strong></p>
  
  <p>I'd like to edit the above to show like this..</p>
  
  <p>www.example.com/article/id/title-goes-here</p>
  
  <p>I have tried with the following code but nothing has changed at all. The only thing I don't know how is to add the slashes to the title.</p>
  
  <pre><code>RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^article/([^/]+)/([^/]+)/?$ webroot/article.php?article_uid=$1&amp;article_title=$2 [QSA,L,NC]
  </code></pre>