.htaccess redirect & hide directory path in url

admin

Administrator
Staff member
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:

the root folder has all the wordpress files

the directory which I'd like to serve as a page

Code:
/inc/css/    
/inc/php/    
/inc/img/

the CSS stylesheet files directory location in the PHP file is
Code:
../inc/css
one step back & 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).

eg: www.domain.com/inc/php/about.php <strong>redirect &amp; rewrite this URL</strong> to www.domain.com/about

the
Code:
.htaccess
in my root

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;

I have tried the simple redirect rule but the folders are exposed in the URL.

Code:
Redirect 301 /about.php       /inc/php/about.php

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.