Mod Rewrite Create Fake Or Hide WordPress Directory

I would like to fake or even hide my wordpress directory from
mysite.com/wp-content/themes/twentyfourteen/page.php to mysite.com/directory/page.php
or even mysite.com/wp-content/themes/twentyfourteen/page.php to mysite.com/fake1/fake2/fake3/page.php

Within my .htaccess file im using the following commands:

Read More
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^wp-content/themes/twentyfourteen/([^/]+)$ /fakedirectory$1 [L]

I;ve also tried

       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^wp-content/themes/twentyfourteen/([^/]+)$ /fakedir1/fakedir2/fakedir3$1 [L]

But for some reason this is not working… Any help would be appreciated!! Thanks

Related posts

Leave a Reply

1 comment

  1. You’re doing the opposite.
    Try this way (assuming your htaccess is in root folder)

    RewriteCond %{THE_REQUEST} s/wp-content/themes/twentyfourteen/([^s]*) [NC]
    RewriteRule . /fakedirectory/%1? [R=301,L]
    
    RewriteRule ^fakedirectory/(.*)$ /wp-content/themes/twentyfourteen/$1 [L]