I'm hosting a couple of Drupal sites with an ISP that virtual hosts with Apache 1.3, and uses a configuration where any URL for a domain that starts with /admin gets shunted to their configuration interface long before Drupal will see it. This is making it a little hard to configure Drupal.

I'm currently getting around this by having a sub-directory that contains a complete copy of Drupal 4.5.2 (same module files, same theme files, everything), but sharing the same database. Because these URLs start with /sub-dir-name, the admin branch maps to /sub-dir-name/admin. This works, but it can be tough to maintain.

Is there a better way to do this? I'm finding that admin items are mostly hard-coded into modules, so hacking the module files is an even worse solution. Is there a way to use a module hook to get in and rewrite a relative internal link? Or if not that, a good place to hack the core files to get this functionality?

Thanks for any help I can get on this one.

Comments

boris mann’s picture

You can't move it, but you can rename it. I had this problem almost 4 years ago: http://drupal.org/node/2476

Torenware’s picture

Well, I've aliased the top level item in the menu (to admin-drupal or something similar). But menus that are inserted by modules using hook_menu hard-wire in "admin". To change those, I'd have to edit each of the module files. This is possible, but an administrative nightmare: everytime I upgrade a client, I'll have to go through the process again.

Am I understanding what you mean by "rename", or do you mean something else?

Thanks,
Rob

Rob Thorne
Torenware Networks

boris mann’s picture

The answer was in this comment -- you can modify the url() function (which is in includes/common.inc) to re-write all URLs containing admin to be something else (all URLs go through this function).

You will have to add this modification every time, but it is a small change. It doesn't like anyone else has found an easier solution in that thread...I moved hosts a long time ago, so it's not a problem for me anymore.

Torenware’s picture

OK, now I get it :-)

Catch the incoming links with mod_rewrite, and rewrite the outgoing links by hacking url().

Yep. "Brilliant".

Much thanks! That should solve it.

Rob

Rob Thorne
Torenware Networks

boris mann’s picture

Please report back when/if it works (it should).

We should probably consider adding this as a section to the install guide -- "Installing Drupal on web hosts that use Ensim".

Torenware’s picture

Boris. It worked, and pretty well.

Again thanks,
Rob

Rob Thorne
Torenware Networks