title: WordPress URL/folder rewrite in htaccess
body: <p>I am trying to mask certain folder in a WordPress installation using the Htaccess file. I am aware that there are plugins available to do exactly what I want but, I do not want to add even more plugins that may have overlapping functions.</p>
  
  <p>The result I am trying to achieve is :</p>
  
  <p>from</p>
  
  <ol>
  <li>example.com/wp-include/js/jquery</li>
  <li>example.com/assets/themes/........</li>
  <li>example.com/assets/themes/parent_theme/......</li>
  <li>example.com/wp-admin/admin-ajax.php</li>
  </ol>
  
  <p>to</p>
  
  <ol>
  <li>example.com/lib/js/jquery.......</li>
  <li>example.com/assets/layouts/.......</li>
  <li>example.com/assets/layouts/main/........</li>
  <li>example.com/ajax</li>
  </ol>
  
  <p>I have tried inputting the code  as below but, this just breaks WP with A 500 internal error</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteRule ^lib/(.*) /wp-includes/ [QSA,L]
  RewriteRule ^assets/layouts/(.*) /assets/themes/ [QSA,L]
  RewriteRule ^assets/layouts/main/(.*) /assets/themes/parent_theme/ [QSA,L]
  RewriteRule ^ajax /wp-admin/admin-ajax.php [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  # END WordPress
  </code></pre>
  
  <p>I have also tried placing the code as follows but this does not provide any results at all (it does not change the 'wp-include' to 'lib')</p>
  
  <pre><code># BEGIN Custom URL Folder Rewrites
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On    
  RewriteRule ^lib/(.*) /wp-includes/ [QSA,L]
  RewriteRule ^assets/layouts/(.*) /assets/themes/ [QSA,L]
  RewriteRule ^assets/layouts/main/(.*) /assets/themes/parent_theme/ [QSA,L]
  RewriteRule ^ajax /wp-admin/admin-ajax.php [QSA,L]
  &lt;/IfModule&gt;
  # END Custom URL Folder Rewrites
  </code></pre>
  
  <p>I would be grateful for any help in solving this problem without the use of an additional function heavy plugin.</p>
  
  <p>This WP installation does not use the standard wp-content folder but a custom folder 'assets'</p>
  
  <p>I would also like to be able to use the code outside of the BEGIN WordPress and END WordPress tags so that I have full control and WP does not remove or edit them.</p>