• Resolved oyagev

    (@oyagev)


    Hi all

    I use wordpress as a framework for a web-service I develop, which among other things allow users to login and post content. Nevertheless, regular users don’t see the classic menues and Dashboard. They see a whole different design and menus.

    I’ve been working and hacking wordpress for a while, and now I’m trying to rename the wp-admin folder.
    Not for security reasons, just for convenience.

    I know that there are lots of issues with renaming this folder, so I created a symbolic link to that folder, named the link ‘newname’.
    I also configured .htaccess to redirect all calls to that folder instead of the wp-admin folder.

    Basically, this works great.
    The only problem is with the super-user’s area:
    The plugins option pages (options and other info) in the admin area are broken.
    For example, lets take the “roles management” plugin.
    Clicking “users” menu and “roles” submenu, dumps this:
    Fatal error: Cannot redeclare class RoleManager in /wordpress/path/wp-content/plugins/role-manager/role-management.php on line 2
    This happens on all option pages for this plugin and all other plugins.

    Now, when I disable ‘newname’ folder and use wp-admin, everything works.
    I also tried to scan all wordpress files for ‘wp-admin’ hardcode and replace with ‘newname’, but it just won’t do.

    Please help me on this,
    should I supply any further info?

Viewing 1 replies (of 1 total)
  • Thread Starter oyagev

    (@oyagev)

    I crashed my head against the keyboard yesterday, after trying to work this out for hours.
    The amazing thing is that 15 minutes after posting here, I found the solution:

    It is all in the wp-includes/vars.php file:
    Iniotially, I changes this line 7 from:
    preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
    to:
    preg_match('#/(wp-admin|newname)/?(.*?)$#i', $PHP_SELF, $self_matches);

    This is just regexp saying search for wp-admin or newname.
    But what i didn’t realize is that it also changes the indexing of the $self_matches array.

    So changing line 8 from:
    $pagenow = $self_matches[1];
    to:
    $pagenow = $self_matches[2];
    Did the trick.

    Thanks anyone who had the patience to read all the way.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirecting calls to wp-admin folder to another symbolic link – breaks plugins’ is closed to new replies.