Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

for example: foobar.com/wp/edit instead of foobar.com/wp/wp-admin

How would I do that?

I've tried using this in htaccess but it won't work:

##### ABOVE THIS POINT IS ALREADY INSERTED BY WORD PRESS
##### Admin Base Rewrite #####
RewriteCond %{REQUEST_URI} wp-admin/
RewriteCond %{QUERY_STRING} !sercretword
RewriteRule .*\.php [F,L]
RewriteCond %{QUERY_STRING} !secretword
RewriteRule ^secret_room/(.*) wp-admin/$1?%{QUERY_STRING}&secretword [L]
##### End Admin Base Rewrite #####
##### BELOW THIS POINT IS ALREADY INSERTED BY WORD PRESS

It was created by Michi Kono. I just can't get it to work though.

I'm not trying to be more secure by obscurity... Its more for functionality. My site will be world editable (kind of like a wiki) but only for registered users. They will go to "/edit" instead of "/wp-admin" to edit or add content.

Thanks for the help!

NOTE: I did see this question: Can I rename the wp-admin folder? But that doesn't have an answer.

NOTE: Stealth Admin plugin doesn't seem to do the trick either.

NOTE: I tried this solution: How to redirect/rewrite all /wp-login requests But I'm not sure where in the htaccess file to place the rewrite rule with respect to the wordpress rules.

share|improve this question

3 Answers 3

You can try the Redirection plugin, it's great for exactly that.

EDIT

You could also for example setup a subdomain that makes a transparent redirect, as in : http://admin.mywebsite.com/ which you would redirect to your wp-admin/ folder. But then I think people would still see the wp-admin/ in all the links (on hover for ex).

share|improve this answer
    
So how would I use it to make /wp/edit be the admin path instead of /wp/wp-admin ? For example, if i'm gunna edit posts, the path would be /wp/edit/post.php instead of /wp/wp-admin/post.php. –  trusktr Jun 19 '11 at 18:13
    
Checkout the screenshots of the plugins page. You simply put in the old path and the new path you want to replace it with. –  mike23 Jun 19 '11 at 18:17
    
Yeah, I saw that. This plugin can make it so that /wp/edit can redirect to /wp/wp-admin, and the user will see "/wp/wp-admin" in the address bar. What I really want is for the address bar to always show "/wp/edit" at all times, not just redirect to /wp/wp-admin. Get what I mean? –  trusktr Jun 19 '11 at 18:28
    
Yes guess I see, so it's not really "functionality" you want but "esthetic"? It's because you don't want people to see the "wp" prefix or something? In that case you could for example setup a subdomain that makes a transparent redirect, as in : http://admin.mywebsite.com/ which you would redirect to your wp-admin/ folder. But then I think people would still see the wp-admin/ in all the links (on hover for ex). –  mike23 Jun 19 '11 at 21:07
    
Thanks for the idea. That could work. I'm creating a map of spots, and anyone can submit or edit spots, so "edit" or "edit-spots" or even "dashboard" seems more friendly and relevant than "wp-admin" edit.foobar.com seems nice though. I'll keep that in mind! –  trusktr Jun 22 '11 at 8:43

Changing a URL always consists of two parts: changing the code that accepts the URLs (to make sure you get something when you go to example.com/edit), and changing the URLs that the code outputs in the HTML (so a link to wp-admin/ will be written as edit/).

The first part is the easy part, and you can do it with Apache rewrite rules. This way you make make a request for example.com/edit look like it was for example.com/wp-admin.

The second part is the hard part, and indeed requires a global search-and-replace, because it is "hard-coded" all over the place. The discussions and Trac tickets Mike linked to in his answer to the older question indicate that the core developers currently have no plans to change this, because they do not see the benefit. Indeed, your use case could also be handled in a way that does not require you to use wp-admin (moving everything to the front-end).

share|improve this answer

As far as your htaccess place the code literally on the first line before any other comments or code added by wordpress or other plugins.

As Jan mentioned rewriting consists of two parts. So beside .htaccess you need to change the admin_url filter

function custom_admin_url($path) { 
    return str_replace('wp-admin', 'dashboard', $path); 
}
add_filter('admin_url', 'custom_admin_url');
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.