How to Change Drupal Login URL

Posted on April 4th, 2016

In this documentation, we can check how to change Drupal login URL. This can be done by installing the module ‘rename_admin-paths’. This module is used to secure Drupal back-end by overriding admin path. This module allows you to:

Rename path like ‘/admin/…’ to ‘/something/…’

Rename path like ‘/user/..’ to ‘/something else/..’

We can use the following steps to install the module ‘rename_admin-paths’.

 

1) Find out the module from drupal.org.

2) Login to Drupal admin panel.

3) Click the button ‘Modules’.

Install modules in Drupal

 

4) Click the option ‘+Install New Module’.

Install modules in Drupal

 

5) Click either one of the option ‘Install from a URL’ or ‘Upload a module or theme archive to install’.

Install modules in Drupal

 

6) Click the button ‘Install’.

Change Drupal Login URL

 

7) Then you will get the message that the ‘Installation was completed successfully’.

Change Drupal Login URL

 

 

If you are using Drupal6, you can get the same feature by using the following code in your ‘settings.php’ file.

function custom_url_rewrite_outbound(&$path, &$options, $original_path) {

if (preg_match(‘|^admin(?![^/])(.*)|’, $path, $matches)) {

$path = ‘backend’. $matches[1];

}

}

 

function custom_url_rewrite_inbound(&$result, $path, $path_language) {

if (preg_match(‘|^backend(?![^/])(.*)|’, $path, $matches)) {

$result = ‘admin’. $matches[1];

}

if (preg_match(‘|^admin(?![^/])(.*)|’, $path, $matches)) {

$result = ‘404’. $matches[1];

}

}

 

That is how we can change Drupal login URL.

 

If you need any further help please reach our support department.

 

 

Leave a Reply