Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress Move wordpress to hidden directory

Discussion in 'Misc WordPress Requests' started by Brad Wickwire, Feb 28, 2018.

  1. Brad Wickwire


    Move wordpress to hidden directory, by Brad Wickwire

    To try and help secure my wordpress I moved wordpress into a directory called “sw-wordpress-hidden” folder in the root and the below is the .htaccess file in the root directory. Everything appears to be working 100% EXCEPT if you go to http://www.jdscountry.com/wp-admin it redirects you to http://www.jdscountry.com/wp-login....ry.com/sw-wordpress-hidden/wp-admin/&reauth=1 which we cant login unless we manually remove sw-wordpress-hidden%2F from the URL. Is there something in the .htaccess file that we can add to fix this or a setting in wordpress that adds the hidden directory name into the redirect URL?

    RewriteEngine on
    RewriteRule ^license.txt /index.php?wph-throw-404 [L]
    RewriteRule ^readme.html /index.php?wph-throw-404 [L]

    RewriteCond %{REQUEST_FILENAME} !wp-cron.php [NC]
    RewriteCond %{REQUEST_FILENAME} !wp-login.php [NC]
    RewriteRule ^wp-([a-z-])+.php /index.php?wph-throw-404 [L]

    RewriteCond %{HTTP_HOST} ^(www.)?jdscountry.com$
    RewriteCond %{REQUEST_URI} !^/sw-wordpress-hidden/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /sw-wordpress-hidden/$1
    RewriteCond %{HTTP_HOST} ^(www.)?jdscountry.com$
    RewriteRule ^(/)?$ sw-wordpress-hidden/index.php [L]

    Move wordpress to hidden directory

Share This Page

Monarch Social Sharing Plugin