Drupal Answers is a question and answer site for Drupal 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

When I run drush user-login username, drush prints a url like http://default/user/reset/1/32323933.... How do I replace default with the actual website name?

share|improve this question
Not tried it so posting a quick comment, the variable site_name is used to save the name of the site in Drupal 6, the command drush vget site_name would give out the same, so probably drush vset site_name WHATEVER_NAME_TO_SET should do the work... – optimusprime619 Dec 25 '12 at 14:27
up vote 10 down vote accepted

You can use option --url:

-l <http://example.com:8888>, URI of the drupal site to use (only needed in multisite environments or when running on an alternate port).

$  drush uli -l yoursite.dev

Or create a record in your aliases.drushrc.php file:

$aliases['yoursite-dev'] = array(
  'root' => '/vhosts/yoursite.dev',
  'uri' => 'yoursite.dev',

Now you have an alias @yoursite-dev and can use it:

$ drush use @yoursite-dev
$ drush uli


Now I prefer to create sites/default/drushrc.php file for each Drupal folder:

$options['l'] = 'http://yoursite.dev';
$options['r'] = '/vhosts/yoursite.dev';

More info about drushrc.php: https://github.com/drush-ops/drush/blob/master/examples/example.drushrc.php

share|improve this answer

I used this command for login into my local site:

drush uli --uri=http://your_local_url
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.