Use htaccess to mask wp-admin folder

Same question: Use htaccess to mask folder name

but the answer doesnt work. My .htaccess file curently look like:

Read More
# BEGIN WordPress
<IfModule mod_rewrite.c> 
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteCond %{THE_REQUEST} ^GET /wp-admin/
RewriteRule ^wp-admin/(.*)$ dashboard/$1 [R,L]
RewriteRule ^dashboard(.*)$ wp-admin$1

and I always get:

The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.

dashboardwp-admin it seems like redirecting to each other; I just want to displaying mysite.com/dashboard but the content must be mysite.com/wp-admin, I am using wordpress 3.5.1. it is possible, isn’t it? I am not good at all in server stuff; so please help;

Thanks.

Related posts

Leave a Reply

2 comments

  1. I’m not sure why you’re getting the The page isn’t redirecting properly error on your browser, but if the /dashboard directory doesn’t physically exist, those requests will get routed through index.php (wordpress). You should try swapping the order of your rules so that the redirects happen before the routing:

    RewriteBase /
    RewriteCond %{THE_REQUEST} ^GET /wp-admin/
    RewriteRule ^wp-admin/(.*)$ dashboard/$1 [R,L]
    RewriteRule ^dashboard(.*)$ wp-admin$1
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c> 
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    

    This way, when you request http://mysite.com/dashboard, the 2nd rule will get applied instead of the RewriteRule . /index.php rule.

  2. This might be the reason why your page isn’t redirecting properly:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    

    Try to change your entire .htaccess with this directives:

    # BEGIN WordPress
    <IfModule mod_rewrite.c> 
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    #Where the
    #suspected
    #code located
    </IfModule>
    
    # END WordPress
    
    #HERE
    RewriteRule ^wp-admin/?$ /dashboard [R,L]
    RewriteRule ^wp-admin/(.*)/?$ /dashboard/$1 [R,L]
    RewriteRule ^dashboard/?$ /wp-admin
    RewriteRule ^dashboard/(.*)$ /wp-admin/$1
    

    If it’s not working, then try to change the comment #HERE with RewriteEngine on.