Drupal rocks! 1st time setup, things were going great until I decided to move Drupal from the /drupal/ directory I initially installed it in to the HTTP root.

The problem lies in that the /admin/ directory for my web hosting provider is the same directory as my web host's control panel. Any time I access something that forwards to /admin/... I end up looking at the login for my web control panel.

Is there any easy workaround? I couldn't find any in the forums. I am communicating with the support of my web hosting provider to see if they can change the /admin/ to /myadmin/ for their panel.

Thanks,

Doug

Comments

vm’s picture

www.yoursite.com/admin/ is the address to your hosts panel ? if this is the case, I'd have to wonder why my admin folder for my host was inside my public root. I'd think they'd want to be more secure then allowing access to the admin panel directly from the public root of a website.

until your host sorts that out, i would guess you can turn off clean urls.

girdwoodguru’s picture

Well what really happens is that any HTTP request with the directory /admin/ in it gets redirected to the IP address of the server followed by /myadmin/.

The admin folder doesn't actually exist in the HTTP root, it just causes drupal to forward out to another location and give a page not found error.

girdwoodguru’s picture

Well, I figured the easiest way to fix this problem is to turn off clean URL's. It solves my immediate problem, but it would be nice to be able to have it on.

drawk’s picture

I have no idea if this would work, but what if you add something like
Redirect /admin /?q=admin

in your .htaccess file?

Just a shot in the dark

---
www.whatwoulddrupaldo.org

dman’s picture

Depends on exactly how the alias was implimented in the first place. I've seen hosts that would do it similar, with an apache alias.
But I'm pretty sure you should be able to over-ride their global, generic method with a more specific virtual-host/.htaccess version of your own.
It would help if you saw exactly what the initial httpd.conf looked like ... and knew enough about Apache and mod rewrite or similar to come up with something. But I can imagine a solution.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

jorhett’s picture

Lots of hosts do this and won't change it. It dates back to the days of Netscape Server 1 -- about 12 years now.

I hope there is a useful way to change the URL to access Administration. Nothing I can find in the menus allows this to be edited.

I did this:
$ ln -s . drupal
http://site.com/drupal/admin

And it works, but it doesn't work cleanly for other users - you have to know to go to that URL.

It would be nice if the /admin URL was change-able inside Drupal to be a different path.

--
Jo Rhett
Net Consonance

jorhett’s picture

You can get around the problem by making URL Aliases with the path.info module, but you may need to make one URL alias for each link below it, which sucks.

Is there any way to make a URL alias recursive?

--
Jo Rhett
Net Consonance

BASE-1’s picture

This is my first time building a site using Drupal, and so far everything seem to be going well.

The only problem I had was with the "Clean URL's" and only for the "/admin" page. All the other "/admin/???" pages worked just fine. The CP software that I am running on the server does the same thing... any request to /admin is redirected via mod_rewrite to the CP login.

To bypass this I was just manually entering the ?q=admin to the end of the URL, to get back to the admin page. Well, I finally got tired of doing this, so I made an entry to the URL aliases that redirects /admin to /ad.min and allows access to the admin page vial the actual menu link. All the other "/admin/???" links stayed the same, but they all still work as well. Also, this "fix" does not interfere with the CP redirect, so there are no problems getting there either.

I hope any other problems I run into are this easy to fix. :))

_________________________________________
United Financial Freedom
Let us put you on the road to financial freedom...
www.YourDebtEliminated.com

tony_maro’s picture

I use HostColor web hosting for one Drupal site and found they mapped not just /admin but /user as well to their own login panel.

I've posted a blog entry that explains how to get around this by simply editing your settings.php file in Drupal 6.

strijee’s picture

function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
// Change all 'admin' to 'dadmin'.
if (preg_match('|^admin(/.*)|', $path, $matches)) {
$path = 'dadmin'. $matches[1];
}

if ($path == 'admin') {
$path = 'dadmin';
}
}

function custom_url_rewrite_inbound(&$result, $path, $path_language) {
if ($path == 'dadmin') {
$result = 'admin';
}
if (preg_match('|^dadmin(/.*)|', $path, $matches)) {
$result = 'admin'. $matches[1];
}
}

fogerty’s picture

The rewrite fix works quite nicely, until Global Redirect module is in use. Any idea how to make this work with Global Redirect too?

jfama’s picture

Two and a half years later, this post saves me. Thanks a million Tony!

JessicaDenkelaar’s picture

I had the same problem with my hosting that I can't use http://www.mysite.com/admin, because the provider uses that path to link to their controlpanel and I've installed drupal 6. I just enabled the path module and made an url alias in the admin (admin/site building/url aliases) and it fixed the problem.

raphael apard’s picture

I wrote a small module for D7, and i need some review ;-).
It's rename_admin_paths

Raphael