Hello everybody!
I've installed Drupal on karlchen.com a few minutes ago.
I enabled URL rewriting. The problem is that my ISP reserved the URL http://www.karlchen.com/admin for the server administration page. Now I can't turn to the admin menu to change the settings.
I haven't got enough skill to disable URL rewriting manually, which is unneccesary anyways because I would like to keep this option.
Probably anyone of you could give me advice how to change the URL of the admin menu.

Thank you very much and sorry for my bad English...
Bobby Grün

Comments

pulsifer’s picture

Bobby Grün’s picture

Thanks!
But how can I change the URL for the admin menu or disable URL rewriting for the admin options only?

pulsifer’s picture

In the file includes/common.inc, in the function url(...), there is a line that reads:

    if (!$clean_url) {

Change that line to:

    if (!$clean_url || strncasecmp($path, 'admin', 5) == 0) {
Bobby Grün’s picture

Thank You!
First of all I've got to say that I'm a real PHP-Dummy...
The function in my version looks like that:

function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
  global $base_url;

  static $script;

  if (empty($script)) {
    // On some web servers, such as IIS, we can't omit "index.php".  So, we
    // generate "index.php?q=foo" instead of "?q=foo" on anything that is not
    // Apache.
    $script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === false) ? 'index.php' : '';
  }

  $path = drupal_get_path_alias($path);

  if (isset($fragment)) {
    $fragment = '#'. $fragment;
  }

  $base = ($absolute ? $base_url .'/' : '');

  if (variable_get('clean_url', '0') == '0') {
    if (isset($path)) {
      if (isset($query)) {
        return $base . $script .'?q='. $path .'&'. $query . $fragment;
      }
      else {
        return $base . $script .'?q='. $path . $fragment;
      }
    }
    else {
      if (isset($query)) {
        return $base . $script .'?'. $query . $fragment;
      }
      else {
        return $base . $fragment;
      }
    }
  }
  else {
    if (isset($path)) {
      if (isset($query)) {
        return $base . $path .'?'. $query . $fragment;
      }
      else {
        return $base . $path . $fragment;
      }
    }
    else {
      if (isset($query)) {
        return $base . $script .'?'. $query . $fragment;
      }
      else {
        return $base . $fragment;
      }
    }
  }
}

Can you tell me what to change there?

pulsifer’s picture

Looks like you have a different version of common.inc

Change the line that reads:

if (variable_get('clean_url', '0') == '0') {

to read:

if (variable_get('clean_url', '0') == '0' || strncasecmp($path, 'admin', 5)) {

I have no way of testing that change, but it should work. Note it will make all url's unclean that begin with "admin", so for example, if you have a url alias "administrative", it will become unclean, too.

sangamreddi’s picture

Try using path alias. If it doesnt work, then hack the common.inc as explained in teh above post

Sunny                      
www.gleez.com | www.sandeepone.com

nzdanzer’s picture

thanks, that really helped