WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My website file structure is like this:

wp/wp files ...

In general in Site Address (URL) I have ...site.com

In index.php I have:

    define('WP_USE_THEMES', true);

Everything works fine but for wp-admin i have ...site.com/wp/wp-admin/

My question is: Can I change the url for wp-admin also to have ...site.com/wp-admin/?

share|improve this question
As in move the location of wp-admin, or as in rewrite the URL? – mor7ifer May 2 '12 at 12:52
wp-admin is at wp/wp-admin and I want to remove from url the wp/ part. I am happy with a rewrite rule also just to not be hard coded with website name. – Alqin May 2 '12 at 13:37

You should be able to regex it with /wp/(wp-admin/.*) and point that to /$1, thus removing the /wp/. You can do this either via .htaccess or via wordpress' rewrite API.

share|improve this answer

if you're happy with a rewrite rule:

in .htaccess:

RewriteRule   ^wp/(.+)$   $1   [nocase,redirect=temp,last]

if might work without the [redirect] flag.

if you want to be very specific:

RewriteRule   ^wp/(wp-admin/.*)$   $1   [nocase,redirect=temp,last]

within WP (the rewrite will need to happen before permalink rewrites, etc):

add_action( 'init', 'gregory_rewrite_wpadmin' );
function gregory_rewrite_wpadmin()
        'top' );

not tested, but trying it won't hurt you ;-)


share|improve this answer

Your Answer


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.