security issue i dont want to give ppl the chance to guess acounts and passwords :) i want only 1 acount and thats it i want it to be a path like 123asdaseqweqfqweqwe i dont care but i dont want /user to exist any more so path module dosent help, Thank you!

Comments

vincent sg’s picture

elsvandeveire’s picture

Unfortunately that thread is still unsolved. So here's the question:

how to change the default user/login path in Drupal, e.g.

mywebsite.com/user

to

mywebsite.com/secretlink

?

For various privacy reasons, knowing this could come in handy. Tx for your advice.

lurkerX’s picture

I have not tested this in a production environment, so I don't know what side effects there may be. Use with caution as you might break your site login.

The following code will change the default path, example.com/user to example.com/secret-login. To see this take effect you will need to empty your cache.

Use hook_menu_alter in your module.

function mymodule_menu_alter(&$items) {
  //Copies the user menu item into our new path item
  $items['secret-login'] = $items['user'];
  //Remove the user menu item so it no longer works
  unset($items['user']);
}

Change "mymodule" in the function name to the name of your custom module and change "secret-login" to the name of the path you want. Repeat the two lines in the function to change other user paths if needed (I have only tested changing the one item).

Best of luck.

Cheers,