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?

  • 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... Dec 25, 2012 at 14:27

4 Answers 4


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


I used this command for login into my local site:

drush uli --uri=http://your_local_url

You can set the uri in a drush site alias file to avoid getting http://default at the beginning of your password reset links.

ie. drush/sites/example.sites.yml

   host: server.example.com
   user: user   
   ssh: '-p 22'
   root: /home/user/public_html/docroot
   uri: 'http://example.com'
   host: server2.example.net
   user: user2
   ssh: '-p 22'
   root: /home/user2/public_html/docroot
   uri: 'http://test.example.net'
   host: localhost
   user: docker
   root: /var/www/docroot
   uri: 'http://example.dev.example.com'

Then use the Drush site alias in the command for the password reset link:

drush @example.dev uli

The example after the @ symbol in the Drush site alias comes from the first part of the Drush site alias filename. The second part comes from the site entry in the file.


You could also export the environment variable DRUSH_OPTIONS_URI.

export DRUSH_OPTIONS_URI=http://example.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.