title: .htaccess redirect & hide directory path in url
body: <p>I have wordpress installed in root directory. I want to use some separate php files as a page on my domain, for which I have made a separate directory which holds all files for serving the php files, of which the directory structure is as:</p>
  
  <p>the root folder has all the wordpress files</p>
  
  <p>the directory which I'd like to serve as a page</p>
  
  <pre><code>/inc/css/    
  /inc/php/    
  /inc/img/
  </code></pre>
  
  <p>the CSS stylesheet files directory location in the PHP file is <code>../inc/css</code> one step back &amp; then css folder.
  I want to <strong>hide folders from URL</strong> such as the files are served from the root (hide the /inc/php/, /inc/css/ &amp; /inc/img/ folders from URL).</p>
  
  <p>eg: www.domain.com/inc/php/about.php <strong>redirect &amp; rewrite this URL</strong> to www.domain.com/about</p>
  
  <p>the <code>.htaccess</code> in my root</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  
  # disable directory browsing
  Options -Indexes
  
  # Prevent hotlinking of images htaccesstools.com/hotlink-protection
  RewriteCond %{HTTP_REFERER} !^$
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com [NC]
  RewriteRule \.(jpg|jpeg|png|gif|ico|pdf|flv|jpg|jpeg|mp3|mpg|mp4|mov|wav|wmv|png|gif|swf|css|js)$ - [NC,F,L]
  
  RewriteRule ^login$ http://domain.com/wp-login.php [NC,L]
  # BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  
  &lt;files wp-config.php&gt;
  order allow,deny
  deny from all
  &lt;/files&gt;
  
  &lt;files ~ "^.*\.([Hh][Tt][Aa])"&gt;
  order allow,deny
  deny from all
  satisfy all
  &lt;/files&gt;
  </code></pre>
  
  <p>I have tried the simple redirect rule but the folders are exposed in the URL.</p>
  
  <p><code>Redirect 301 /about.php       /inc/php/about.php</code></p>
  
  <p>also I have some more files in the PHP folder on which I'd like to apply the same rule of <strong>redirect &amp; rewrite URL</strong> &amp; <strong>hide folders from URL</strong> &amp; remove the PHP extention.</p>