Drupal - How to replace "default" with website domain name during drush user-login

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).
--uri=<http://example.com:8888>

$  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

Update:

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

<?php
$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

Tags:

Drush